Set Coordinate 0,0 As Top-Left Corner

I have set my config.lua to use a 16:9 aspect ratio and scale with zoomEven.
As a result, a device with a 2:1 aspect ratio (such as Corona’s) has the top and bottom of the virtual screen extend slightly beyond the top and bottom of the physical screen. Thus if I draw something with a y position of 0, it will not be (entirely) visible.

Is there a way to shift the virtual screen so that an object drawn with a y position of 0 will also be at y position 0 on the physical screen? (I want all of the screen overflow to go to the bottom/right of the screen, instead of being split half on either side.)

And can I also set it so that the tap and touch events return a similarly shifted location? (touching the very top of the physical screen sets event.y to 0)

Hi @SuuperW,

Yes, you can shift the alignment of the content area to be non-centered… just set the xAlign and/or yAlign properties in your content area setup. Options are “left”/“center”/“right” or “top”/“center”/“bottom” respectively. See the guide here for details:

https://docs.coronalabs.com/guide/basics/configSettings/index.html#xalign-yalign

Take care,

Brent

That’s what I was looking for. Thanks!

Hi @SuuperW,

Yes, you can shift the alignment of the content area to be non-centered… just set the xAlign and/or yAlign properties in your content area setup. Options are “left”/“center”/“right” or “top”/“center”/“bottom” respectively. See the guide here for details:

https://docs.coronalabs.com/guide/basics/configSettings/index.html#xalign-yalign

Take care,

Brent

That’s what I was looking for. Thanks!