Corona Dynamic Scaling

Hello,
That would be the correct method (loading images during Runtime) if the texture memory limit is being exceeded. However, you might see a small “skip” in your game when you load large images during Runtime. This is a limitation of mobile devices as they load (larger) assets.

For testing, please add this line to your “main.lua”…

print(1/display.contentScaleX, 1/display.contentScaleY)

Then, run the app in the Corona Simulator and observe the value in the Terminal/console. Switch the “Window > View As” from “iPhone” to “iPhone 4” to “iPhone 5” to “iPad” to “iPad Retina” and tell me the values that you see.

Thanks!
Brent [import]uid: 200026 topic_id: 35627 reply_id: 141816[/import]

Hi,
This are values are values

values : 1/display.contentScaleX, 1/display.contentScaleY
iphone : 1 1
iphone4 : 2 2
iphone5 :2.3666666690177 2
ipad: 2.1333333333333 2.4000000572205
ipad Retina :4.2666666666667 4.8000001144409

Thanks [import]uid: 220966 topic_id: 35627 reply_id: 141821[/import]

OK… and you say “It’s loading only single a.png for iphone and ipad both”…

Which exact devices in the previous post (which iPhone models and which iPad models) are using which image version?
[import]uid: 200026 topic_id: 35627 reply_id: 141822[/import]

I am developing iphone+ipad app
I am using three images,
ie.
a.png = 480*500 (width*height)
a@2x.png = 960*1000
a@4x.png = 1920*2000

imageSuffix = {
["@2x"] = 2,
["@4x"] = 4,
},

This suffix info in config.lua file

As I told I am using this method to load image
display.newImageRect(“a.png”,480,500)
This method automatically choose image as per device resolution.
When I running game on iphone4/ipad/ipad3, it loading images but not smoothly and it stucks the game

Thanks.
[import]uid: 220966 topic_id: 35627 reply_id: 141825[/import]

Are there transparent areas in your backgrounds?

If not, you could try using .jpgs and you may find you can fit your 50-odd images into memory before the game starts. Otherwise as Brent says, loading these large images into memory on the fly will cause your game to stutter.

EDIT: Thinking about it, does the file type/quality of the source file affect how much texture memory is used…perhaps a texture is a texture once it’s loaded into memory :-/ [import]uid: 93133 topic_id: 35627 reply_id: 141848[/import]