0

In the release notes of Kobold2D v2.0.4, it says:

added C function isWidescreenEnabled() to report if app is running on a widescreen device with widescreen "enabled" (ie when Default-568h@2x.png is included in the project)

What do I need to do in order to use the isWidescreenEnabled function, other than installing Xcode 4.5 and Kobold2D v2.0.4, and including Default-568h@2x.png in the project?

Roger
  • 1,020
  • 1
  • 8
  • 13

2 Answers2

0

You don't need to use isWidescreenEnabled(). You could just use winSize and look for a height of 568 (for portrait UI; for a landscape UI, look for a width of 568). Here's some sample code (for a portrait UI):

CGSize screenSize = [CCDirector sharedDirector].winSize;
if (screenSize.height == 568) {
  // You have a device with a 4" retina display; do something special
}
Roger
  • 1,020
  • 1
  • 8
  • 13
0

You can use isWideScreenEnabled like so:

if (isWideScreenEnabled())
{
    // widescreen-specific code here ...
}

It doesn't require Xcode 4.5 or the Default-568h@2x.png. It's based on the answers and comments in this question.

Community
  • 1
  • 1
CodeSmile
  • 64,284
  • 20
  • 132
  • 217