I need to calculate how to center multiple objects within a certain width.
I have between 1 and 6 letters. Depending on how much letters are displayed, they have to be centered together within display.contentWidth.
Something like:
[lua]
for i=1,#LetterTable do
Tiles[i].x = _W / 2 - (Number * 102)
Number = Number + 1
end
[/lua]
Above code doesn’t work, unless youre displaying only 1 letter.
Since I’m not very good at this, maybe someone can help me out here?
Thanks in advance!