Icons and Launch Images

Icon support was not entirely working for the iOS target. Now as of what is in SVN, icon support via NMML "icon" node is working fully including covering the retina iPad icon dimension (144px). The NMML spec also now includes a "launchImage" node so NM…

Viewing 1 to 17 (17 Total)
Icons and Launch Images

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Icon support was not entirely working for the iOS target. Now as of what is in SVN, icon support via NMML "icon" node is working fully including covering the retina iPad icon dimension (144px).

The NMML spec also now includes a "launchImage" node so NME projects can define the image that is shown by the OS while the app is launching. They work like this:


<launchImage path="Default.png" width="320" height="480" />
<launchImage path="Default@2x.png" width="640" height="960" />
<launchImage path="Default-Portrait~ipad.png" width="768" height="1024" />
<launchImage path="Default-Portrait@2x~ipad.png" width="1536" height="2048" />
<launchImage path="Default-Landscape~ipad.png" width="1024" height="768" />
<launchImage path="Default-Landscape@2x~ipad.png" width="2048" height="1536" />


This covers all permutations of current iPhone and iPad launch orientations and sizes. These are automatically added into the Xcode project configuration. The names do matter as these happen to be the names Xcode uses behind the scenes. This seems better to me as it prevents the names from having to be hard coded into the NME installer[s].

Tags:
Posted on June 28, 2012 at 11:32 AM

Philippe

Philippe
Total Posts: 261
Joined: September 08, 2011

Re: Icons and Launch Images

Fantastic news!

Just curious: are you sure about the launcher imaged sized? I think they should account for the top bar height.

Posted on June 28, 2012 at 1:45 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

You're right, that does usually need to be taken into account. For NME as it stands today, the spec Info.plist file that goes into the generated Xcode project does have UIStatusBarHidden set to "true" so the launch image and app will fill the whole screen.

If that were made variable or configurable via NMML we would need to consider that 20/40px in the launch image dimensions.

Thanks for bringing that up!

Posted on June 28, 2012 at 1:55 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

I should also mention: NME doesn't process the images at all so as of right now the width and height are pretty much ignored. This might be convenient because it means you can just switch out the launch images at your leisure if you want to account for the status bar. NME will just pass whatever you give it into the project configuration.

Posted on June 28, 2012 at 1:57 PM

Philippe

Philippe
Total Posts: 261
Joined: September 08, 2011

Re: Icons and Launch Images

Might be a good occasion to set UIStatusBarHidden depending on the 'fullscreen' attribute value ;)

Posted on June 28, 2012 at 2:36 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

hehe it's funny that's exactly what I was thinking. Since you mentioned it, I'll just put that in there now so we don't forget.

Posted on June 28, 2012 at 2:38 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

OK, that is in there now as well now. UIStatusBarHidden will be true in the Info.plist if there is either fullscreen="true" attribute in the window tag or a <set name="fullscreen" if="target_ios" /> in the NMML.

Posted on June 28, 2012 at 2:58 PM

exdev

exdev
Total Posts: 93
Joined: March 09, 2012

Re: Icons and Launch Images

Thanks!
this work great on iOS + NME 3.4.3, some questions:

- Why there is no Default-Landscape image for iPhone/iPod resolutions?
- Doesn't work in android, isn't it?

Best

Posted on September 04, 2012 at 6:19 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

I'm also curious about whether this works on Android launch images, or if we have to roll something ourselves for Android.

Posted on September 05, 2012 at 7:32 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

I'm having trouble getting the iOS icon support working, unless I use the SVG option. (which is great choice, but not for my particular use case)

I'm using this in my NMML file.

<icon path="Icon.png" width="144" height="144" ></icon>

I also tried this, per the spec. (https://code.google.com/p/nekonme/source/browse/trunk/tools/command-line/spec.nmml)

<icon path="Icon.png" size="144" ></icon>

I then thought that I might have to provide icons at each exact size (and following Apple's guidelines), but that didn't work either.

<icon path="Icon.png" size="57" ></icon>
<icon path="Icon@2x.png" size="114" ></icon>

Whichever way it is, and regardless of the end target (iPhone, iPhone Retina, iPad), I get an app with a blank icon. Yet, I peek at the ios export folder and see the icons there. The only thing that's "off" is that when I open the generated Xcode project, I notice that the icons aren't showing up in the project screen (splash images are though).

Is there something I'm doing wrong? I'm using 3.4.2.

Edit: When I run on the device vs. the simulator, it stops me with this:

warning: Icon specified in the Info.plist not found under the top level app wrapper: Icon.png (-19007)
warning: Icon specified in the Info.plist not found under the top level app wrapper: Icon.png (-19007)
warning: iPhone/iPod Touch: Info.plist: Unable to verify icon dimensions, no icon found. You must define CFBundleIconFile, CFBundleIconFiles, or provide a default Icon.png that is 57x57 (-19013)
warning: iPad: Info.plist: Unable to verify icon dimensions, no icon found. You must define CFBundleIconFile, CFBundleIconFiles, or provide a Unable to validate your application. - (null)

Posted on September 06, 2012 at 2:21 AM

singmajesty

singmajesty
Total Posts: 2146
Joined: August 25, 2011

Re: Icons and Launch Images

I believe the iOS project template is made where it will not embed the relevant tags in the generated Xcode project for an icon unless the project includes all of the required icon sizes.

Instead of using a single "HAS_ICON" variable, perhaps this could be modified so either there is a separate variable for each icon size, or there is a single variable for "ICONS" which includes all the markup for all the icons that are available.

SVG is working because it is able to generate all the desired icon sizes.

Posted on September 06, 2012 at 4:50 AM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

Requiring all of them is fine - that's how the launch images appear to work, but it should be mentioned in the toolchain (as a warning or error) and documented on the NMML spec.

At a glance at IOSInstaller.hx, it looks like NME is expecting: "Icon.png", "Icon@2x.png", "Icon-72.png", "Icon-72@2x.png", so that means...

<icon path="Icon.png" size="57" />
<icon path="Icon@2x.png" size="114" />
<icon path="Icon-72.png" size="72" />
<icon path="Icon-72@2x.png" size="144" />

This generates the proper icons in the ios export directory, and I see an icon in the iOS simulator. However, when I run in the Retina simulator, it uses the lower resolution icon (Icon.png vs. Icon@2x.png), and when building for the device, I get this error:

warning: iPad: Icon.png: icon dimensions (57 x 57) don't meet the size requirements. The icon file must be 72x72 pixels, in .png format (-19014)

Posted on September 06, 2012 at 12:37 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

I finally traced this back to the info.plist template that NME ships. This template only works on iOS 5.1 and above. There should be a fallback for iOS 5.0 users and below who may not be on a computer that's able to install the latest SDK.

http://drekka.github.com/2012/07/30/iOS-icons-and-splash-screens.ht...

The solution that got me past this error was to copy and paste the CFBundleIconFiles key/array pair to the top level. This way, it's able to satisfy both the < 5.1 and >= 5.1 cases.

Posted on September 06, 2012 at 2:55 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

There's nothing in the plist that is specific to 5.1. In fact, it will work (and I have used it) back to iOS 4.x.

The differentiator is your Xcode version. What are you using?

As for Android, no, this does not cover Android, but that will not be difficult to add.

Thanks,
Patrick

Posted on September 06, 2012 at 2:58 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

I'm on Xcode 4.1.

Posted on September 06, 2012 at 3:00 PM

crayfellow

crayfellow
Total Posts: 204
Joined: November 28, 2011

Re: Icons and Launch Images

OK. can't hurt to upgrade to the version dispatched by the Mac App Store, makes it easier to keep up to date, too. Unless you have a reason to hold on to 4.1 that is what I would recommend.

Cheers!
Patrick

Posted on September 06, 2012 at 3:03 PM

Jon

Jon
Total Posts: 272
Joined: March 08, 2012

Re: Icons and Launch Images

I'm actually redistributing a tool, so this isn't about me upgrading to an Xcode version, but making it so that it at least covers a reasonable base, which means that the minimum is Snow Leopard and either 4.0/4.1.

The latest available for Snow Leopard is 4.2 (and buried pretty deeply), and from what I know, the major cutoff point is 4.3 in terms of things changing.

I'm OK with keeping the change on my end, but just as a heads up to anybody else on Snow Leopard who might be bumping into this.

Posted on September 06, 2012 at 3:08 PM