Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Question in sf::Text
Print
Pages: [
1
]
Author
Topic: Question in sf::Text (Read 1562 times)
0 Members and 1 Guest are viewing this topic.
flashrocket
Newbie
Posts: 21
Question in sf::Text
«
on:
April 16, 2015, 02:56:45 pm »
I created
sf::Text
and used
setPosition(50,50);
.
but when i give
getGlobalBounds();
I interestingly get the following
If you notice the attachment you see that
top
is showing
58
rather than
50
.
Where is this extra 8 pixels coming from?
How to remove them?
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Question in sf::Text
«
Reply #1 on:
April 16, 2015, 03:08:39 pm »
Text is aligned on its baseline, not on its top. You would get 50 if you had the tallest possible character in your string (like an accentuated capital letter).
Logged
Laurent Gomila - SFML developer
flashrocket
Newbie
Posts: 21
Re: Question in sf::Text
«
Reply #2 on:
April 16, 2015, 03:09:38 pm »
Thank You.
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Question in sf::Text
anything