1
General / Re: sf::Color member not updating on sf::CircleShape draw
« on: February 04, 2021, 09:04:31 pm »
Right after the Update() function gets called, I call the Draw() function which calls the DrawSight() function. The Entity class has quite a few variables, and functions which would have been quite a lot of code if I posted it all.
In the Entity class, I have a private variable
The log shows that it changes, but it somehow resets after. I tried passing the color not as a reference to the setter to copy it, but it still resets. Would any other functions help you understand what's going on that I should show?
In the Entity class, I have a private variable
sf::Color m_SightColor;
which by default is (Red: 255, Green: 255, Blue: 255, Alpha: 255). I have setters/getter for this variable, and when I return the sf::CircleShape shape; to draw, I set the color of the shape with the GetSightColor() function. I tried this using the private member on its own without the function (m_SightColor) and it yielded the same result: (Red: 255, Green: 255, Blue: 255, Alpha: 255); even though I change it when the mouse moves over it.The log shows that it changes, but it somehow resets after. I tried passing the color not as a reference to the setter to copy it, but it still resets. Would any other functions help you understand what's going on that I should show?