Image precision position

Hi everyone.
I am building my game and i am positioning my images, and i need a precision on the position of the images, and when i do some like:

image.x = _W*0.5
image.y= _H*0.5

the image is on the center of screen but i need only a little for the left, like:

image.x = _W*0.52
image.y= _H*0.5

but if i do this, my image will blur, and i am using some like:

image.x = (_W*0.5)*0.45
image.y= _H*0.5

some multiplications between position values, to take the precision position that i want, but i dont know if it is the best method or if it can have problem between different screens.

anyone know if this code can have problems or bugs? or other ways to do that?

Thanks :slight_smile: [import]uid: 26056 topic_id: 20675 reply_id: 320675[/import]

Hey there,

You could use math.round() to prevent getting and decimal values.

Eg;

[lua]image.x = math.round(_H*0.52)[/lua]

http://developer.anscamobile.com/reference/index/mathround

Peach :slight_smile: [import]uid: 52491 topic_id: 20675 reply_id: 81189[/import]

Thanks peach, great help for me :slight_smile: [import]uid: 26056 topic_id: 20675 reply_id: 81311[/import]

Not a problem - I’ve been there too :wink:

Peach [import]uid: 52491 topic_id: 20675 reply_id: 81443[/import]