if i want to place a textfield right in the center of a shape, i have to do this.
self.textfield:setY(self:getY()+((self:getHeight()+self.textfield:getHeight())/2))
what bugs me here is the second '+' in the formula.
Normally if you position things it has to be minus. So it seems to me that the Texfield.getY() returns the most bottom pixel of the textfield, and it renders the text upwards, while normally everything gets rendered downwards.
Is this intentional?
Comments
The TextField position calculated from down
As TTFont inherits form FontBase, you can use FontBase methods to determine ascender: http://docs.giderosmobile.com/reference/gideros/FontBase/getAscender#FontBase:getAscender or simply get bounds to compensate for this offset