display.newText align is not working. Is there a work around for it?
It’s working for me.
Can you show me a code snippet of what’s not working for you please?
Here is my code.
local fontName = “RussoOne-Regular.ttf#Russo One”
local highScoretextOptions =
{
parent = textGroup,
text = “HIGH SCORE 0”,
x = 275,
y = 75,
width = 512, --required for multiline and alignment
height = 40, --required for multiline and alignment
font = fontName,
fontSize = 24,
align = “left” --new alignment field
}
local highScoretext = display.newText( highScoretextOptions )
highScoretext:setFillColor(1.0, 1.0, 1.0, 1.0)
Oh I see. The text alignment actually does work, but Corona is not producing a bitmap at the width that you are specifying. That is, the resulting text bitmap/texture is condensed to fit the text.
So, what you can do at the moment to work-around this is to re-position the text object to where you want it to be based on its “contentWidth” property.
Cool… That worked. Thx.
Mike,
The next daily build (#2484) will fix this issue so that you won’t have to reposition the text object anymore. Thanks for bring this issue to our attention.
It’s working for me.
Can you show me a code snippet of what’s not working for you please?
Here is my code.
local fontName = “RussoOne-Regular.ttf#Russo One”
local highScoretextOptions =
{
parent = textGroup,
text = “HIGH SCORE 0”,
x = 275,
y = 75,
width = 512, --required for multiline and alignment
height = 40, --required for multiline and alignment
font = fontName,
fontSize = 24,
align = “left” --new alignment field
}
local highScoretext = display.newText( highScoretextOptions )
highScoretext:setFillColor(1.0, 1.0, 1.0, 1.0)
Oh I see. The text alignment actually does work, but Corona is not producing a bitmap at the width that you are specifying. That is, the resulting text bitmap/texture is condensed to fit the text.
So, what you can do at the moment to work-around this is to re-position the text object to where you want it to be based on its “contentWidth” property.
Cool… That worked. Thx.
Mike,
The next daily build (#2484) will fix this issue so that you won’t have to reposition the text object anymore. Thanks for bring this issue to our attention.