Hi,
I’m doing something that I thought would be easy and I just can’t get it to work.
I have 3 score numbers that I want all lined up with right justification so they would look something like this:
90
990
99999
Here is my code:
local round_ending_scoreOptions =
{
text=string.format("%-15u", 0),
font = gameSettings.titleFont,
fontSize = 20,
width=200,
align = “right” --new alignment parameter
}
round_ending_score = display.newText( round_ending_scoreOptions )
round_ending_score:setFillColor(0, 0, 0)
round_ending_score.anchorX = 1
round_ending_score.x = stoneBench.x + stoneBench.width/2 -150
round_ending_score.y = scoreTextLine2.y
round_ending_score:toFront()
round_ending_score.alpha = 0
WTgroup:insert( round_ending_score )
local round_ending_lifetime_scoreOptions =
{
text=string.format("%-15u", 0),
font = gameSettings.titleFont,
fontSize = 20,
width=200,
align = “right” --new alignment parameter
}
round_ending_lifetime_score = display.newText( round_ending_lifetime_scoreOptions )
round_ending_lifetime_score:setFillColor(0, 0, 0)
round_ending_lifetime_score.anchorX = 1
round_ending_lifetime_score.x = stoneBench.x + stoneBench.width/2 -150
round_ending_lifetime_score.y = scoreTextLine3.y
round_ending_lifetime_score:toFront()
round_ending_lifetime_score.alpha = 0
WTgroup:insert( round_ending_lifetime_score )
local round_ending_scoreToNextPlaneOptions =
{
text=string.format("%-15u", 0),
font = gameSettings.titleFont,
fontSize = 20,
width=200,
align = “right”
}
round_ending_scoreToNextPlane = display.newText( round_ending_scoreToNextPlaneOptions )
round_ending_scoreToNextPlane:setFillColor(0, 0, 0)
round_ending_scoreToNextPlane.anchorX = 1
round_ending_scoreToNextPlane.x = stoneBench.x + stoneBench.width/2 -150
round_ending_scoreToNextPlane.y = scoreTextLine4.y
round_ending_scoreToNextPlane:toFront()
round_ending_scoreToNextPlane.alpha = 0
WTgroup:insert( round_ending_scoreToNextPlane )
Anyone see what I am doing wrong?
Thanks!
Arthur