Hi All
This is probably my (lack of) understanding as I’m still quite new to Corona but i’m creating a simple app and I’m fighting a problem.
I’m trying to display a background image with a few labels in a group and have it centered on the screen. It seems to work great for (almost) all devices (iPad, iPhone4 and android) but when I view it on the (original) iPhone the content is being shoved to the top of the screen.
The code is below but here is a project file that shows this happening – Just load it up and change skins and you’ll see it centering fine everywhere except for the original iPhone.
I though (think) I was handling this all properly by setting my config.lua to force a 1024x768 virtual screen and it does seem to be (mostly) – I’ve been pulling my hair out trying to sort out what I’m doing wrong (or perhaps it’s a corona bug?)
Thanks
Link to project: http://db.tt/2NDreDR
[lua]-- this seems to work fine on every model except iphone…
– Just put a gray background on the visible area
bg=display.newRect( 0,0,1024,768)
bg:setFillColor(100,100,100)
– Create a group witha background image and two labels
group=display.newGroup()
back=display.newImage( group,“back.png”)
local label = display.newText(group, “top”,200,-50,native.systemFont, 32)
local label2= display.newText(group, “bottom”,200,280,native.systemFont,32)
– scale it to fill the screen
local scale=display.contentScaleX
group:scale(scale,scale)
– position it to the center by setting cetner ref point and then
– setting x & y to center of screen
group:setReferencePoint(display.CenterReferencePoint)
group.y=display.contentHeight/2
group.x=display.contentWidth/2[/lua]
-john
[import]uid: 48162 topic_id: 8470 reply_id: 308470[/import]