Retina display - Universal app

Hello,

I searched all the forums but no luck, the solutions I’ve found didn’t answer my question.

How can I setup the project in order to have an Universal build which supports Retina Display - or at least export it for iPhone 3GS & 4 with retina display.

I have all the graphics @2x and normal size and I configured my config.lua file to letterbox but it’s not working.

Can anyone paste the correct config.lua file and other settings I need to do?

Thank you very much! [import]uid: 8241 topic_id: 15881 reply_id: 315881[/import]

I have my project set up with 320x480 and letterbox, and display.newImageRect works perfectly fine.

You may want to read up on:

https://developer.anscamobile.com/content/displaynewimagerect

http://developer.anscamobile.com/content/display-objects#Images_with_Dynamic_Resolution

http://developer.anscamobile.com/content/configuring-projects#Dynamic_Content_Scaling

Good luck!

[import]uid: 67217 topic_id: 15881 reply_id: 58777[/import]

BTW, for the text display, I use Jonathan Beebe’s newRetinaText. It us awesome.

Only thing I’m truly missing is dynamic image resolution for spritesheets. I’ve seen a few good suggestions on how to implement it, but I haven’t had a chance to really work through it.
[import]uid: 67217 topic_id: 15881 reply_id: 58778[/import]

Cheers mate, I will take a look and try what you suggested. [import]uid: 8241 topic_id: 15881 reply_id: 58847[/import]

I followed all the tutorials from the links above and I still have a problem on 3 & 3GS devices.

In simulator the game is displayed a quarter of the screen.

Can someone tell me how I can solve this problem?

Thank you! [import]uid: 8241 topic_id: 15881 reply_id: 59346[/import]

Have you read up on this too?

http://blog.anscamobile.com/2010/11/content-scaling-made-easy/

And… here’s my config.lua (in current state, which may change over time):

[lua]application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
xAlign = “center”, – center is the default, so if center is desirable, this line can be removed
yAlign = “center”, – center is the default, so if center is desirable, this line can be removed

fps = 30, – only other choice is 60 fps. 30 is the default, so if 30 is desirable, this line can be removed

– antialias is false by default, which will greatly improve performance of vector objects,
– and should make little visual difference on the latest high-dpi devices.
antialias = false,

imageSuffix =
{
["@2x"] = 2,
["@3x"] = 3,
},
},
}[/lua]

I’m no expert, but reading all relevant materials & documentations that I could find on Ansca site (including APIs, Docs, blog posts and forum posts) enabled me to get my game to support Retina Display & Dynamic Image Resolution (except for spritesheet). I hope you will be able to make headway too.

Good luck!

[import]uid: 67217 topic_id: 15881 reply_id: 59352[/import]

I might also suggest that you setup your “config.lua” file to begin with retina-quality settings, and scale down from there to accomodate older devices. I detail this approach in my post from about a week ago:

New retina approach

The strategy outlined probably isn’t suitable for a project well into development, because it might involve a significant amount of re-positioning/resizing vector-based display objects (if you use any, that is). But for a NEW project, I think this is a superior solution versus setting your “base” as an old iPhone3 and then scaling up and using add-on functions like “NewRetinaText()” which can especially be a headache when you deal with different alignment reference points.

Brent Sorrentino
Ignis Design [import]uid: 9747 topic_id: 15881 reply_id: 59374[/import]

Hi Brent, I saw your post about new retina approach some time ago and bookmarked it for my future project. As you noted above, I do not wish to redo my existing project, so I’m sticking with my current setting.

Also… I could be wrong, but the problem that @andreib21 is having may have nothing to do with config.lua – but rather, more to do with properly setting up the display objects…
[import]uid: 67217 topic_id: 15881 reply_id: 59387[/import]

Thank you guys for your replies.

I got it to work now but I have a question. In a couple of days I will pay the license and will be able to build the project file. When I do this, will Corona take the @2x images and create new images in the folder @1x for older devices that don’t support retina display? Or it will just scale the iomages, increasing the memory on older devices?

[import]uid: 8241 topic_id: 15881 reply_id: 59517[/import]

@andreib21, you need to create your own @2x image. The app simply loads the @2x image in place of standard size image. And if @2x image doesn’t exist, the app will automatically scale the original image, resulting the image to be fuzzy on higher resolution screen.

So, here’s what you do:

  1. Create image.png (standard size, say 100x100)
  2. create image@2x.png (2x size, i.e., 200x200)
  3. Use image.png in your code (i.e., don’t use image@2x.png anywhere in your code)

The app will automatically select image@2x.png when appropriate. If image@2x.png does not exist in your project folder, the app will simply scale image.png.

My understanding is, the build/app size would depend on what files you have in your project folder, and texture memory usage depends on the image size being used at run time. If you are running the build on older device (i.e., 3GS, for example), it won’t load image@2x.png, thus the texture memory usage should be smaller (compared to higher resolution device that uses image@2x.png).

Good luck. [import]uid: 67217 topic_id: 15881 reply_id: 59542[/import]