It looks like you're new here. If you want to get involved, click one of these buttons!
local textfield = TextField.new(nil, "some other text with default font") textfield:setAnchorPosition(0.5,0.5) textfield:setPosition(0,0) stage:addChild(textfield) textfield:setRotation(45) |
Comments
but in this case it is setAnchorPosition, so you need to provide position in logical dimensions where you want the anchor point to be.
If you want to achieve effect like on 0.5,0.5 anchor point then you would need to get width and height of the textfield and divide them by 2 and set as anchor positions.
Reason for such difference is because Sprites contents may change and thus changing the width and height of sprite