width related question

So, i’m really new at Corona, and there is something I don’t understand.

I want to make a checkboard, but I want it to be exactly the size of the width of the devices you’re playing with.

So I’m tried something like

 local tileWidth = (display.contentWidth / 100) \* 12

So there will be 8 tiles in a grid and it should (in my mind) take the full  width of the screen

this is how I call the grid:

for i = 1, tilesAcross do for j = 1, tilesDown do levelImg.x = (j - 1) \* tileWidth end end

But the trouble is that the grid always start a few pixels offscreen to the left, which I guess I can solve adding a left margin but then the margin would ba different on every devices.

How can I solve this.

I just want the board to start at the edge of the screen.

Thanks everyone!

The display objects draw based on their center.  You may need to add or subtract half the width of the square to the X position to get it where you want.

Yes, that was exactly it, by the time my question got approved, I got that figured out!

Anyway thanks for the reply

The display objects draw based on their center.  You may need to add or subtract half the width of the square to the X position to get it where you want.

Yes, that was exactly it, by the time my question got approved, I got that figured out!

Anyway thanks for the reply