I’m working with a 720x1280 screen in portrait. Positioning a single image/imageRect or sprite. The pixel values for the images are all as expected, but for the container to function, I need to double all the pixel values. This works the same on simulator, android and windows build. I’ve googled, checked forums, corona guide on containers, and api, cannot find any reason. Can anyone explain why this is happening? Is it a known issue?
In the code below, I display a sprite near middle of screen, to demonstrate the container partially clipping the sprite. If I set the container dimensions correctly at 710,640, then the sprite incorrectly falls outside of the container.
[lua]-- portrait screen 720x 1280y
container = display.newContainer( 1420, 1280) – container dimensions have to be DOUBLE of screen dimensions
sweet = display.newImageRect( “gfx/1.png”, 80, 80)
sweet.x, sweet.y = 720, display.contentCenterY --displays half way down screen, half showing clipped by screen border
dispGroup = display.newGroup()
dispGroup:insert(sweet)
container:insert( dispGroup, true ) --extra part of sweet hidden by container at x=1420, y=1280, dimensions doubled?
–container.anchorX = .5
–container.anchorY = .5
–container.x = -50
–container.y = -50
–container:translate( 0, display.contentHeight*0.1 )[/lua]