Trouble aligning text

I have a high score text at the bottom of my screen and I am having a problem.
I have “High Score” and next to it I have t the number. T seems to move around by itself. I have tried with and without the x & y Scale. I have tried everything I can think of.

[lua]local scoretext = display.newText(“High Score:”,(_W/6),(_H*.94),“Helvetica”,20*2)
–scoretext.x = (_W*.35); scoretext.y = (_H*.97);
scoretext.xScale=0.5;scoretext.yScale=0.5;
scoretext:setReferencePoint(display.CenterReferencePoint)
scoretext:setTextColor(255,255,255,255);
menu:insert(scoretext);

local t = display.newText( ‘’,(scoretext.x+75),(_H*.94),“Helvetica”,20*2);
t:setReferencePoint(display.CenterReferencePoint)
–t.x = _W *.50; t.y = _H*.97;
t.xScale=0.5;t.yScale=0.5;
t:setTextColor(255,255,255,255);
menu:insert(t)
t.text=score – update t to the score

[import]uid: 17539 topic_id: 16254 reply_id: 316254[/import]

Since you are using the display.CenterReferencePoint reference point your text will move depending on the size of the score value. Do you want it left justified? Right justified? One other item is that I’ve found that text can be somewhat squirrly with its position if you set the position and then insert the text into the group. This may have nothing to do with your issue, but generally I’ve avoided it by making sure to do it in this order:

create text
insert into group
set alignment
set position

The other thing that may be happening is if you are changing the text (as the score changes), may sure to set the text, then set the position, since I believe it is relative to the “size” of the text. So if the size changes, but it was set to the position when you originally create it, you may not get it where you want it.

If you have a minimal app that can show this I’d be glad to debug it for you. [import]uid: 16734 topic_id: 16254 reply_id: 60500[/import]

I removed the x, y coordinates from the top line and placed them one line below. I built the program and it seems to work so far. I have had this problem since I started with corona in Feb 11. I thought I would get around to fixing the small problems later. I guess later is here.
Thanks for your help.

[lua]local scoretext = display.newText(“High Score:”,0,0,“Helvetica”,20*2) –
scoretext.x = (_W*.35); scoretext.y = (_H*.97);
scoretext.xScale=0.5;scoretext.yScale=0.5;
scoretext:setReferencePoint(display.CenterReferencePoint)
scoretext:setTextColor(255,255,255,255);
menu:insert(scoretext);

local t = display.newText(score,0,0,“Helvetica”,20*2);–,
t:setReferencePoint(display.CenterReferencePoint)
t.x = _W *.65; t.y = _H*.97;
t.xScale=0.5;t.yScale=0.5;
t:setTextColor(255,255,255,255);
menu:insert(t)
t.text=score – update t to the score[/lua]

What are some of the titles from Homebrew Software?
I would like to check out what everybody is doing.
[import]uid: 17539 topic_id: 16254 reply_id: 60532[/import]

@kingmike40,

Homebrew was founded back in the early 90’s. I did some side scrollers and also distributed games from my European partners while the shareware market was strong. Once that died down I went back into the game industry and have only recently resumed developing titles; specifically for the iPhone/Android markets.

My first Corona based project was to take Arrow Antics and port it to the mobile devices supported by Corona. I am waiting on new art to spruce up the game, then that will be released.

My second Corona based project was for my current employer (not Homebrew). I was able to port one of our games in about 4 days. Corona is definitely a great SDK, albeit with a few minor shortcomings.

If I could bend the ears of the Corona Staff I would request a few changes that would greatly enhance the functionality and usability of Corona. Unfortunately, it seems that most posts on this forum go unanswered the Ansca. Hopefully that will change as they generate more cash and can hire more staff. [import]uid: 16734 topic_id: 16254 reply_id: 60555[/import]