1
Graphics / Re: [SFML2] Bounding boxes around sf::Text characters
« on: September 14, 2019, 02:16:33 am »
I was having the same problem while working thru a tutorial on LinkedIn Learning. Ultimately, I found that if I used a non-fractional number for both the "x" and "y" coordinates as in:
...it would work. Is there anything inherently wrong with doing this? In my case it was only for the "Score =" line, so it didn't really need to move or animate, per se. The reason I had a fractional number in the first place, is because I implemented some code to "scale" the text and position of the text based on the size of the game window.
Chris
textObject.setPosition((int)xPos, (int)yPos)
...it would work. Is there anything inherently wrong with doing this? In my case it was only for the "Score =" line, so it didn't really need to move or animate, per se. The reason I had a fractional number in the first place, is because I implemented some code to "scale" the text and position of the text based on the size of the game window.
Chris