Hey guys,
So I have these texts in an array and randomly selected:[code]
array = {}
local i = 1
array[i]= display.newText(“I want these texts to be divided into lines!!”, 0, 0, 0, 0, native.systemFont, 15*2);array[i].alpha=0;i=i+1
array[i]= display.newText(“I want these texts to be divided into lines!!”, 0, 0, 0, 0, native.systemFont, 15*2);array[i].alpha=0;i=i+1
array[i]= display.newText(“I want these texts to be divided into lines!!”, 0, 0, 0, 0, native.systemFont, 15*2);array[i].alpha=0;i=i+1
array[i]= display.newText(“I want these texts to be divided into lines!!”, 0, 0, 0, 0, native.systemFont, 15*2);array[i].alpha=0;i=i+1
function selectext()
local randomtext = math.random(1,#array)
–1 to highest index in the table
array[randomtext].xScale = 0.5
array[randomtext].yScale = 0.5
array[randomtext].alpha=1
array[randomtext].x = _W/2
array[randomtext].y = _H/2 - 30
array[randomtext]:setReferencePoint(display.CenterReferencePoint)
array[randomtext].width = 500
array[randomtext].height = 0
end
selectext()[/code]
However, like this, my width is right, but instead of multi-lining, it shrinks my text into one line, with the size considerably smaller.
Any thoughts?
Thanks
[import]uid: 95495 topic_id: 20786 reply_id: 320786[/import]