img size, different phones - auto scale?

Hi there.

So… I’m currently trying to learn corona and the possibilities it has.
Im working on a game at this moment, and I’m going to release it for iOS and Android users. The problem is that it’s alot of different phones and screen sizes.

Is there any code i can use so the graphic’s automaticly scales down to fit the size of every phone? Or do i have to make 10000 of different sizes on them?

What’s the professionals way to do it? :slight_smile: [import]uid: 177857 topic_id: 35022 reply_id: 335022[/import]

You can quite easily make one app that will fit all screen sizes, whether it’s iOS or Android,

I make my apps based on 320x480 with letterbox. All you need to do is use content scaling and have image assets @2x and @4x for higher resolution screens.

Also you can negate black border letterboxing by having for instance your background image much larger so that it fits 4:3 devices or 16:9 devices.

eg. My backgrounds are typically 400x600; 800,1200 for @2x; and 1600, 2400 for @4x devices.

By centering them on the 320x480 screen they will cover all device sizes.

And here would be a good config.lua to get you started:

[lua]application = {
content = {
width = 320,
height = 480,
–antialias = true,
scale = “letterBox”,
fps = 30,

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

},
}[/lua] [import]uid: 179960 topic_id: 35022 reply_id: 139227[/import]

We did a blog post a few weeks ago called the “Ultimate Config.lua file” that covers how to target the various devices. See this post:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

[import]uid: 199310 topic_id: 35022 reply_id: 139273[/import]

Thank you Rob and Icy! [import]uid: 177857 topic_id: 35022 reply_id: 139346[/import]

You can quite easily make one app that will fit all screen sizes, whether it’s iOS or Android,

I make my apps based on 320x480 with letterbox. All you need to do is use content scaling and have image assets @2x and @4x for higher resolution screens.

Also you can negate black border letterboxing by having for instance your background image much larger so that it fits 4:3 devices or 16:9 devices.

eg. My backgrounds are typically 400x600; 800,1200 for @2x; and 1600, 2400 for @4x devices.

By centering them on the 320x480 screen they will cover all device sizes.

And here would be a good config.lua to get you started:

[lua]application = {
content = {
width = 320,
height = 480,
–antialias = true,
scale = “letterBox”,
fps = 30,

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

},
}[/lua] [import]uid: 179960 topic_id: 35022 reply_id: 139227[/import]

We did a blog post a few weeks ago called the “Ultimate Config.lua file” that covers how to target the various devices. See this post:

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

[import]uid: 199310 topic_id: 35022 reply_id: 139273[/import]

Thank you Rob and Icy! [import]uid: 177857 topic_id: 35022 reply_id: 139346[/import]