Images longer than iphone screen size are scaled down to fit in screen in SDK 2.0. Version 1.13 works fine.

Hi,

When I wish to have a scrollable image vertically, to simulate iphone native scrolling, but with image longer than iphone screen, I use the following code (helpAbout image has 320x960 pix) so it has 2 times iphone screen’s high:

local help=display.newImage(“helpAbout.jpg”,0,0)

local touchy=function(event)
if help.y+event.yDelta>0 and help.y+event.yDelta<480 then
transition.to(help,{y=help.y+event.yDelta, time=500, transition=easing.outQuad})
end
end

help:addEventListener(“drag”,touchy)

In SDK 2.0 simulator shows a scaled down image to fit the entire .jpg file of 320x960 pix in 480 vertical pix, but in SDK 1.13 it shows exactly what I wish to do, it means the correct size and the ability to scroll it up or down according to the code above.

So, questions here is: which behavior will be finally adopted by Corona SDK?. I prefer the SDK 1.13 functionally which allows me to use image longer than iphone screen to scroll them up or down, without any scaling.

[import]uid: 3022 topic_id: 820 reply_id: 300820[/import]

We’re going to offer the ability to turn on/off the auto-scaling. By default, it will be on to conserve memory (there’s a limit to how much image/texture memory is available on devices). The scaling works by scaling images down to the next power of 2 larger of each dimension of the screen size. For iPhone, the screen is 320x480, so we scale down to fit inside 512x512. For the Nexus One, the screen size is 480x800 so we scale down to fit inside a 512x1024 rect. For max sizes that are rectangular (as with the Nexus One), we determine the scale such that the image (if rotated) will fit maximally within the screen.

Note that most OpenGL-ES hardware out there limits the dimensions to 1024x1024. So we’ll always scale down to that rectangle should the image be larger.

Looking forward, we’re investigating ways to support larger images than 1024x1024 by auto-tiling in the Corona Game Edition. [import]uid: 26 topic_id: 820 reply_id: 1804[/import]

Hi Walter

The above is fair enough and in theory is preferred when loading a large image for display on an iPhone screen. What messes up is when we need an exact image size / position and to be able to know what size (as original) it will appear on the iPhone.

If you were to resize images would it not then be preferable to scale the image (in corona) automatically so it then occupies the space the original image would have take up, that way you get the memory saving / power of 2 but we still get the image behaving as the original should. [import]uid: 5354 topic_id: 820 reply_id: 1865[/import]

This is sort of a combined bug + new feature (optionally overriding the autoscale), but it’s logged as #119 now. [import]uid: 3007 topic_id: 820 reply_id: 1991[/import]