How to run code differently basing on each flatform?

Hi,

I just want to make a simple HelloWorld project, which displays a label like that:

  • “Hello cocos2dx - Android” when I run it on Android devices
  • “Hello cocos2dx - iOs” when I run it on iOs devices

I don’t know the best way to this thing in cocos2dx, please help me, thanks.

There’s CC_TARGET_PLATFORM macro defined in platform/CCPlatformConfig.h. Example usage:

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// code
#endif

Thank Igor so much.