I have score. I want it to change and grow to the right, instead of center. How do I change this? Thanks.
[lua]local scoreWord = display.newText ( “Score”, 20, 10, “Font”, 35 )[/lua] [import]uid: 25216 topic_id: 12269 reply_id: 312269[/import]
I believe this is what you are after, read the paragraph called “Common Object Methods”
I just did some of this tonight and here’s the code from the link above that should work for you…
-- A text object is created and is aligned left at point x=20
local textObj = display.newText("A short string", 0,0, nil, 14);
textObj:setReferencePoint(display.CenterLeftReferencePoint);
textObj.x = 20;
-- Later, the textObj.text property is assigned a new string value of different length,
-- causing the object's width to change, but not its reference point.
-- Consequently, the text is no longer aligned left at point x =20
textObj.text = "This string has several more characters than before..."
-- Work-around:
-- Reset the text object's reference point and x position
-- after you update its text property:
textObj.text = "This string has several more characters than before..."
textObj:setReferencePoint(display.CenterLeftReferencePoint);
textObj.x = 20
Hope that helps,
Croisened
[import]uid: 48203 topic_id: 12269 reply_id: 44721[/import]