Hello,
I’ve been evaluating Corona for a bit now and am just about ready to buy.
I’m having trouble getting content scaling to work correctly and David Rangel from Corona asked that I post as many details on this forum as possible in the hopes of getting assistance. As soon as I am comfortable with the resolution to this problem, I’ll be happy to purchase Corona SDK.
For now, I’m using Ceramic as my tile engine but if I choose Corona SDK, I’ll be switching to Million Tile Engine.
Basically, I have tiles that are 70x70 in size for testing. I’ve used Texture Packer to combine them into a tilesheet with the appropriate options and have imported them into Tiled as tilesets.
I created a 10 tall x 15 wide map and I am loading it in a landscape-only game using Ceramic.
I would expect the content size to be 700px tall (70*10) and 1050px wide (70*15).
I want the screen to be stretched so that these conditions are always met:
- There are always 10 tiles visible on the Y axis and 15 tiles on the X axis
- The four corners/edges of the map are always aligned perfectly with the physical screen of each device
- I understand stretching/distortion may occur with some devices
My config file
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 700 or math.ceil( 1050 / aspectRatio ), height = aspectRatio \< 1.5 and 1050 or math.ceil( 700 \* aspectRatio ), scale = "zoomStretch", fps = 30, imageSuffix = { ["@2x"] = 1.3, }, }, }
My main.lua
----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here display.setStatusBar( display.HiddenStatusBar ) local bg = display.newRect(0, 0, 1050, 700) bg.x = display.contentWidth/2 bg.y = display.contentHeight/2 bg:setFillColor(135,206,250) local ceramic = require("Ceramic") local map = ceramic.buildMap("test.json")
Screenshots can be viewed at this link. The iPhone and iPhone4 are correct while all others exhibit issues.
https://www.dropbox.com/sh/3skxhcol3izr3dz/wQbS-QQ6YZ
The blue background is separate from the tilemap but it also has issues.
Of note, I’ve tried zoomStretch, zoomEven, and letterBox as well as several combinations of xAlign and yAlign in config.lua
Anyone have an idea what I am doing wrong?