Dynamic Content Scaling problem

Hi,

First time on this board… I couldn’t find a search function so hopefully this wasn’t already addressed.

I’m doing a very simple app… for now, it layers a series of identically sized pngs on top of each other in the center of the screen. My original image size is 2000x2000 – I wanted to go larger than any current device supports so when there’s a retina display for the iPad (someday), this app would still look great. The objects should scale so they just fit in the center of the screen. (I wanted to make sure all images were scaled down rather than up.)

I tried various combinations of numbers in the config.lua file, but the closest I found to what I want is:

application =
{
content =
{
width = 1024,
height = 1024,
scale = “letterbox”
}
}

But I’m not finding a proper setting for the config.lua file that scales the objects properly for all hardware types. It works fine for iPad and iPhone 4. But for iPhone and all the Droid versions, the image is scaled to 1/4 size and is positioned near the upper left.

Shouldn’t this work, or is this a possible bug? It seems that if I’ve set up my images for a 2000 pixel wide screen, then I should be able to use width=2000 and height=2000 and all the rest should scale properly.

I went back and tried resizing all images to 768x768, but that didn’t help the problem.

So, is there a bug?

Let me know if you need to play with my project files to resolve this.

Thanks,

David
[import]uid: 9905 topic_id: 2631 reply_id: 302631[/import]

David, you may be hitting the image autoscaling behavior of Corona where we autoscale large images to preserve texture memory. See “Image Autoscaling” at http://developer.anscamobile.com/content/display-objects#display.newImage_

We’re working on creating recommendations, but the easiest thing to do is to set your content width/height for the primary test device. Typically, this is the iPhone (320x480) [import]uid: 26 topic_id: 2631 reply_id: 8351[/import]

Thanks, Walter, that makes sense. [import]uid: 9905 topic_id: 2631 reply_id: 8357[/import]

I’m doing another test to see if I can do “pan and scan” within an oversize image (i.e., the “Ken Burns effect”). I have an image (24-bit png) that is 2048x1536, or double the size of an iPad screen. I want to start with the image zoomed in to a spot, and then pull back and pan so the image is centered.

All worked ok except for the resolution. I can tell that when I’m zoomed in, the image appears to have been already converted to a 1024x768 image, even though I’m setting the display.newImage isFullResolution flag to true. Also, my expectation is that when I tell the image to display at scale=1, it should really be zoomed in to 1/4 of the image (since the image is twice the size of the screen). But it’s not. At scale=1, it exactly fits the size of the screen. So I have to use scale=2 to zoom in, and then the image is blurry.

Here’s the simplified code:

  
display.setStatusBar(display.HiddenStatusBar)  
  
local background = display.newImage("rs\_wide.png", 0, 0, true)  
  
local scale = 2  
background.xScale = scale  
background.yScale = scale  
background.x = 1024  
background.y = 258  
  
local delay = 4000  
transition.to( background, { time=2500, delay=delay, x=512, transition = easing.inOutQuad } )  
transition.to( background, { time=2500, delay=delay, y=384, transition = easing.inOutQuad } )  
transition.to( background, { time=2500, delay=delay, xScale=1, transition = easing.inOutQuad } )  
transition.to( background, { time=2500, delay=delay, yScale=1, transition = easing.inOutQuad } )  

and for the config.lua file, I tried it both with and without the size parameters, with no difference.

application =  
{  
 content =  
 {  
 width = 768,  
 height = 1024,  
 scale = "none",  
 antialias = true,  
 fps = 30,  
   
 },  
}  

Any ideas? Is it possible that your isFullResolution flag is broken? Or that your simulator (or compiler) is scaling anyway even though a 2048x1536 image (or even 2048x2048 image) should be fine for the iPad?

Here’s an update… I just tried running my test program (with the 2048x1536 image) on my iPad. All I got was a white screen.

I then used Photoshop to scale down the original image to 1/2 the size, 1024x768, and it then worked on the iPad.

Note that the look of the image was identical when I prescaled it in Photoshop.

So, questions:

  1. Shouldn’t I be able to display a 2048x2048 texture on the iPad?
  2. Why was my 2048x1536 image rescaled by the Corona compiler, even though I had the flag on?
  3. Is there any advantage to using jpegs instead?
    Thanks
    [import]uid: 9905 topic_id: 2631 reply_id: 9260[/import]

I found a workaround, but I’d rather be able to use full 2048x2048 images:
http://developer.anscamobile.com/forum/2010/10/28/images-over-1024x876-not-working-ipad#comment-10849 [import]uid: 9905 topic_id: 2631 reply_id: 10852[/import]