I’m working on an app that uses a tab bar,list views, and storyboard (love it!) throughout and being that I’m nearly done with the logic I started on the polishing and wanted to add retina text, but I ran into an issue. What I had was the content in the config file set to 320x480 so I could use “points” instead of pixels to layout the interface, which has worked wonderfully until I started in on retina text. Because the size of the text changes I was going to use a scalefactor to determine the location in the interface. In other words, I would check for the resolution to be 320 and handle the alignment one way, but if it was 640 then handle it for the newer iPhones.
That’s when I figured out that by setting the content size in the config file to 320x480 made it so that display.contentWidth always returns whatever is in the config file.
The easiest solution I could see for being able to set the content size in the config file AND be able to use a scalefactor for retina and non-retina displays is to have a display.resolutionWidth that gets the actual resolution of the display instead of what it was set to in the config file.
Having something like this would allow me to align text properly depending on the resolution as well as scaling images down for the 3GS and leaving them full size for retina displays.
One thought I had was to somehow check the resolution in the config file and save that to a variable or a database BEFORE I set the content size, but I don’t know if that’s even possible.
So a few questions: I think everyone agree that it would be wonderful if display.newText just took care of retina text automatically so we don’t even have to think about it. Is this possible in the near future?
If not, does a feature exist that allows me to check actual resolution, not just the content size? Or is there a way to check content size in the config before setting it? If anyone has a way around this or any advice I’d greatly appreciate it. Thanks in advance. [import]uid: 39480 topic_id: 18705 reply_id: 318705[/import]
[import]uid: 14018 topic_id: 18705 reply_id: 71885[/import]