display.newText positioning

Hello.
Does anybody know how to position the textObject accuratly?

it seems its not possible since there is no way of determine the actual size nor the exact position of the object. And the values seems to differ a lot depending on wich platform you are on.

[import]uid: 103182 topic_id: 23573 reply_id: 323573[/import]

You can set the reference point or you can just set the x and y coordinates. Just check the API sheet.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 23573 reply_id: 94581[/import]

Hi Jordan.
I’m aware of the properties and functions of the text object. However it seems like the values aren’t 100 % correct.
For example, if i would like to animate a text , letter by letter, it’s impossible to position them one after another correctly due to the incorrect width and height values of the text object. [import]uid: 103182 topic_id: 23573 reply_id: 94630[/import]

If you wanted to do something like that you would have to use Lua tables a for loops.

[lua]local table = {
1 = “h”
2 = “e”
3 = “l”
4 = “l”
5 = “o”
}[/lua]

Then you would want to run through all of the values in a for loop and display them on the screen.

[lua]for i=1, 5 do
display.newText(table[i],10 + (i*5), 10, native.systemFont, 20)
end[/lua]

Hopefully this helps (and works).

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 23573 reply_id: 94653[/import]