Simulator output vs device output - graphics all over the place and driving me crazy

Hello all

EDIT: my original post was poorly written, let me put this in a simpler way

I can’t get to grips with co-ordinates on simulator vs. device.

I’m using a very basic config.lua with width 320 height 480 landscape and letterbox. The device I’m testing on is a 480x800 Samsung Galaxy Trend. The problem is that what I get on simulator is completely different to what I get on device.

What would be the correct strategy of achieving the following:

Case 1

  • A red box
  • Centered and sitting on the bottom of the landscape screen
  • Width = 50% of screen width
  • Same output on simulator and on any supported device (ratio changing is ok)

Case 2

  • The same red box
  • Centered and sitting at the bottom of the screen
  • Able to be scaled dynamically between say width = 50% to width = 25% of screen and remain in its position
  • Same output on simulator and any supported device (ratio changing is ok)

Once someone a little bit opens to me the correct strategy (config.lua etc and reference points) of how this problem should be handled in Corona, I’ll be able to figure it out from there.

You mean its not edge aligned?

If so then the problem is that in corona canvas can be smaller then physical screen on device. So if you set something at (0, 0) then it can be not in top left corner but moved from corner. This offsets describing distance between 0 point and left or top edge of actual screen are available under display.screenOriginX and display.screenOriginY respectively.

It’s like real screen edges are outside Corona canvas so you have additional “frame” around your canvas.

You mean its not edge aligned?

If so then the problem is that in corona canvas can be smaller then physical screen on device. So if you set something at (0, 0) then it can be not in top left corner but moved from corner. This offsets describing distance between 0 point and left or top edge of actual screen are available under display.screenOriginX and display.screenOriginY respectively.

It’s like real screen edges are outside Corona canvas so you have additional “frame” around your canvas.