So no matter what I try, I cannot seem to figure out the content pane and dynamic scaling. I’ve tried the codes from both turotials supplied on the website and other tricks to get it to work. I just can’t seem to find the resolution I need for all sizes. Either my picture gets cut off and so do my buttons, or there is a black box above and below my images on the tablets. I can get my images to work with a few of the phone settings, but not all of them. Can anyone tell me what I’m doing wrong? I’ll provide sample code below.
-- calculate device aspect ratio local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 400 or math.ceil( 600 / aspectRatio ), height = aspectRatio \< 1.5 and 600 or math.ceil( 400 \* aspectRatio ), scale = "letterbox", fps = 30, -- image size would be 400x600, 800x1200, and 1600x2400 imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 4.0, } }, } print( aspectRatio, application.content.width, application.content.height )
and here is code from my main:
local sFooter1 = display.newImageRect("mainMenu/homebutton\_hudleft.png", 713, 450) local sFooter2 = display.newImageRect("mainMenu/homebutton\_hudright.png", 713, 450) sFooter1.x = 50 sFooter2.x = 550 sFooter1.y = 220 sFooter2.y = 220 sFooter1.alpha = 0 sFooter2.alpha = 0 transition.to(sFooter1, {time = 2000, alpha = 1, x = 355}) transition.to(sFooter2, {time = 2000, alpha = 1, x = 355, onComplete = uiLock})
Can anyone tell what I’m doing wrong?