how to work with a variety of sensors, screen sizes, and operating system versions is vital? [import]uid: 203413 topic_id: 33854 reply_id: 333854[/import]
What do you mean by sensors?
As far as screen sizes, there are 3 main methods of doing this:
-
Fixed resolution and let the app “Letterbox”.
Pros: You have a fixed grid. You know that it’s going to be exactly 320x480
Cons: Most devices are not that ratio and you will get black bars unless you provide a bigger background but when that happens, 0,0 may not be the top left corner nor will display.contentWidth,display.contentHeight be the bottom right corner. -
Fixed resolution with zoom Stretch
Pros: 0,0 will be Top/Left, display.contentWidth,display.contentHeight will be bottom right and the screen has a fixed grid.
Cons: your objects will be stretched or compressed if you’re not on a 320x480 device. -
Flexible resolution.
Pros: 0,0 will be Top, Left, display.contentWidth, display.contentHeight will be bottom right, but the screen shape changes so that the width could be 480 or 568 or whatever you’ve set it up for depending on the device.
Cons: you have to use relative placement since the distance from left to right is now variable.
We just did a blog post on this called the “Ultimate config.lua”. See:
http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/
As for dealing with the operating systems, luckilly for Corona, there are not that many things you have to deal with, but you can use the system.getInfo(“model”) API call to gather information where you can behave differently based on if your on Amazon or Barnes and Noble.
[import]uid: 199310 topic_id: 33854 reply_id: 134611[/import]
What do you mean by sensors?
As far as screen sizes, there are 3 main methods of doing this:
-
Fixed resolution and let the app “Letterbox”.
Pros: You have a fixed grid. You know that it’s going to be exactly 320x480
Cons: Most devices are not that ratio and you will get black bars unless you provide a bigger background but when that happens, 0,0 may not be the top left corner nor will display.contentWidth,display.contentHeight be the bottom right corner. -
Fixed resolution with zoom Stretch
Pros: 0,0 will be Top/Left, display.contentWidth,display.contentHeight will be bottom right and the screen has a fixed grid.
Cons: your objects will be stretched or compressed if you’re not on a 320x480 device. -
Flexible resolution.
Pros: 0,0 will be Top, Left, display.contentWidth, display.contentHeight will be bottom right, but the screen shape changes so that the width could be 480 or 568 or whatever you’ve set it up for depending on the device.
Cons: you have to use relative placement since the distance from left to right is now variable.
We just did a blog post on this called the “Ultimate config.lua”. See:
http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/
As for dealing with the operating systems, luckilly for Corona, there are not that many things you have to deal with, but you can use the system.getInfo(“model”) API call to gather information where you can behave differently based on if your on Amazon or Barnes and Noble.
[import]uid: 199310 topic_id: 33854 reply_id: 134611[/import]