Hi, I’m developing an app using the iPhone 5 Simulator: the problem is that if i put the object higher that 480, when I open the iPhone 4 Simulator it doesn’t show the object…
( I’ve posted two images to show you what’s the problem )
Thank you
Hi, I’m developing an app using the iPhone 5 Simulator: the problem is that if i put the object higher that 480, when I open the iPhone 4 Simulator it doesn’t show the object…
( I’ve posted two images to show you what’s the problem )
Thank you
It would be better if you showed us some minimized code.
But when you say if you place the object “higher than 480”, that is a bit strange. The vertical Y scale starts at 0, so top of screen is y = 0.
That’s strange…
local header = display.newImage(“header.png”)
header.y=display.contentHeight-480
localGroup:insert(header)
With this code ( on the iPhone 5 Simulator ) it shows the object at the top of the screen…
display.contentHeight is the height of the screen. So you are taking the height of screen and then subtracting 480. You are going a long way to place something at the top of the screen. If you want to place something at the top of the screen then just do
[lua]
header:setReferencePoint(display.TopLeftReferencePoint)
header.x = 0
header.y = 0
[/lua]
display.contentHeight is appropriate to use when you want to use something at the bottom.
[lua]
footer:setReferencePoint(display.BottomLeftReferencePoint)
footer.x = 0
footer.y = display.contentHeight
[/lua]
Edit: setReferencePoint should be before you set x and y
Ok, thank you 
It would be better if you showed us some minimized code.
But when you say if you place the object “higher than 480”, that is a bit strange. The vertical Y scale starts at 0, so top of screen is y = 0.
That’s strange…
local header = display.newImage(“header.png”)
header.y=display.contentHeight-480
localGroup:insert(header)
With this code ( on the iPhone 5 Simulator ) it shows the object at the top of the screen…
display.contentHeight is the height of the screen. So you are taking the height of screen and then subtracting 480. You are going a long way to place something at the top of the screen. If you want to place something at the top of the screen then just do
[lua]
header:setReferencePoint(display.TopLeftReferencePoint)
header.x = 0
header.y = 0
[/lua]
display.contentHeight is appropriate to use when you want to use something at the bottom.
[lua]
footer:setReferencePoint(display.BottomLeftReferencePoint)
footer.x = 0
footer.y = display.contentHeight
[/lua]
Edit: setReferencePoint should be before you set x and y
Ok, thank you 