Text alignment different on different devices (Android GalaxyS4, Android LG G2)

Hey - Having a minor issue with text alignment when testing on different devices.

scoreText.x = display.contentWidth scoreText.x = scoreText.x - scoreText.width / 2 scoreText.anchorX = 0

The simulator with:

  • Galaxy S4 align text the same, and there are no issues

  • LG G2 is different, and the text is a good 10-20 pixels further to the right.

How can I make the text the same regardless of device?

Thanks!

just note: anchorX will only work on next text positioning

It’s because work area sizes and positions (like content width) aren’t aligned with physical sizes of screen. There are paddings around area to match different screen resolutions and dimensions.

To get it right please refere to http://docs.coronalabs.com/api/library/display/screenOriginX.html

Ty :smiley:

just note: anchorX will only work on next text positioning

It’s because work area sizes and positions (like content width) aren’t aligned with physical sizes of screen. There are paddings around area to match different screen resolutions and dimensions.

To get it right please refere to http://docs.coronalabs.com/api/library/display/screenOriginX.html

Ty :smiley: