Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error positioning text at (0, 0)  (Read 1410 times)

0 Members and 1 Guest are viewing this topic.

lefsler

  • Newbie
  • *
  • Posts: 11
    • View Profile
Error positioning text at (0, 0)
« on: September 30, 2014, 03:03:51 pm »
Hi,

I had some issues rendering the text (SFML 2.1) at some positions, then i changed the position to (0, 0).
I loaded with
font.loadFromFile(textControl->getFontPath());
text.setFont(font);
 

And rendered with:

    text.setString("TEXT");
    text.setScale(1, 1);
    text.setOrigin(0, 0);
    text.setPosition(0, 0);
    window.draw(text);
 

but the result is:



And as u can see, there is some spacing. I saw the calculation method to do the actual max character height subtract by the text character size and subtract by the localBounds height... but no luck until now.

Thanks :)
Ignore the gray rectangle there :).


zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

lefsler

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Error positioning text at (0, 0)
« Reply #2 on: September 30, 2014, 04:05:04 pm »
Thanks, i will try that.