Letterbox Scaling on the Simulator Wrong?

Hi,

My base content size is 320 x 480. The scale factor for Ipad is 2.133. So, using letterbox scaling the image should be scaled to 683 x 1024. So 768 - 683 = 85 , there should be a gap of 85 pixels, or two 42.5 pixel black bars on each side of the image if it’s centered.

However, on the simulator in Ipad view, using display.screenOriginY, it only shows a gap of 20 pixels.

Am I missing something or is the simulator off?

Any help is appreciated. Thanks. [import]uid: 153562 topic_id: 33782 reply_id: 333782[/import]

What does your config.lua look like? If you have it width=320, height=480 and you’re looking at an iPad, then it’s basically converting things to points based on 320x480. If you divide the remaining 42.5 pixels by your 2.1333 scale factor, guess what it comes out to? Yep, 20.

Now if your config.lua was 683 x 1024 then you should get your 42 back.
[import]uid: 199310 topic_id: 33782 reply_id: 134328[/import]

Hi Rob,

So the gap in real size is in fact 42.5 pixels on each side, but it’s 20 pixels for the purposes of moving things around the image’s coordinate system? [import]uid: 153562 topic_id: 33782 reply_id: 134339[/import]

Yes… [import]uid: 199310 topic_id: 33782 reply_id: 134344[/import]

Thanks Rob :smiley: [import]uid: 153562 topic_id: 33782 reply_id: 134392[/import]

What does your config.lua look like? If you have it width=320, height=480 and you’re looking at an iPad, then it’s basically converting things to points based on 320x480. If you divide the remaining 42.5 pixels by your 2.1333 scale factor, guess what it comes out to? Yep, 20.

Now if your config.lua was 683 x 1024 then you should get your 42 back.
[import]uid: 199310 topic_id: 33782 reply_id: 134328[/import]

Hi Rob,

So the gap in real size is in fact 42.5 pixels on each side, but it’s 20 pixels for the purposes of moving things around the image’s coordinate system? [import]uid: 153562 topic_id: 33782 reply_id: 134339[/import]

Yes… [import]uid: 199310 topic_id: 33782 reply_id: 134344[/import]

Thanks Rob :smiley: [import]uid: 153562 topic_id: 33782 reply_id: 134392[/import]