ipad/Iphone Scaling.

This is in my config file:

  
application =   
{  
 content =   
 {   
 width = 768,  
 height = 1024,   
 scale = "zoomEven"  
 }  
}  
  

I’m using the flight control source provided by ancsa, Whenever they display anything they scale it to the devices screen width and height. How would I go about positioning stuff exactly where I want them using this method?

So when they position a button they have done it using this:

playButton.x = display.contentWidth / 2  
playButton.x = display.contentHeight/ 2  

So when I position my objects now I need them to take into account the device screen size, but I’m unsure of how to set them in a desired position using this method. Does anyone recommend a different way for developing for iphone and Ipad? and is it easy to convert from the method being used now as all of the sources images are displayed using this method.

Thanks, Lewis.

[import]uid: 68741 topic_id: 11398 reply_id: 311398[/import]

recommend you read http://blog.anscamobile.com/2010/11/content-scaling-made-easy/ and the article on dynamic resolution for images. These two should give you a fairly good idea.

if you are targetting iOS iphone and ipad , then one of the easier ways could be to start with 320 and 480 as your content area with letterbox mode.(define this in config.lua) Then for the higher resolution devices like iphone 4 and ipad provide image-@2x.png files to perform image substitution and use display.newImageRect () instead of newImage.

The area defined in your config.lua is yout virtual screen in which you can directly use coordinates if you prefer to.

you could also scale the other way, but it is less efficient in terms of texture memory used.

Hope this helps [import]uid: 55009 topic_id: 11398 reply_id: 41305[/import]

Thanks for the detailed reply, in the open source code at the moment there are bits of code like this:

local lengthFromCenter = display.contentHeight \* (3/4)   

I would change those to support 320 x 480?

Then letterbox mode would take care of the rest? [import]uid: 68741 topic_id: 11398 reply_id: 41306[/import]