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

Author Topic: Problem with character positioning  (Read 5841 times)

0 Members and 1 Guest are viewing this topic.

ineed.help

  • Jr. Member
  • **
  • Posts: 56
    • View Profile
Re: Problem with character positioning
« Reply #15 on: July 25, 2014, 12:06:42 pm »
You mean like this?:

yPos = 0 - font.getGlyph('A', fontSize, false).bounds.top;
 
This seems to work for me; it places the "l", which is one of the longest characters, at the y-position it's supposed to.

With "getLocalBounds().top", I do it like this:
tempSprite.setPosition(xPos + font.getGlyph(str[i], fontSize, false).bounds.left, yPos + font.getGlyph(str[i], fontSize, false).bounds.top - tempSprite.getLocalBounds().top);
 
Yet it does absolutely nothing.

Well, I guess it doesn't matter, since I seem to have fixed everything.
« Last Edit: July 25, 2014, 06:09:14 pm by ineed.help »