[ios | Android] World History Maps

Greetings cocos2d-x users! I wanted to share with you some information about an app I built using cocos2d-x that is not a game! The app is called “World History Maps: The World”. This is the first in what will hopefully be a series of apps. Others will focus in with more detail on various regions in the world. This first app displays a map for every year from 3000BC to the current year. I did not make the maps - they were created by John Nelson of www.worldhistorymaps.com.

The maps John has created are all SVGs. For performance, I convert them all at build time to compressed textures.

Some development details that may interest you:

  • I used nanosvg to convert each country/region from SVG into a bitmap: https://github.com/memononen/nanosvg
  • I used the PVR texture converter tool “PVRTexToolCLI” to create PVR textures for iOS because I found it did a much better job at preserving quality than the one that comes with XCode.
  • On Android, the most widely supported compressed texture format is ETC1. Unfortunately, that format does not support alpha channels. So I used etcpack to split the PNGs into two etc textures - one with RGB only and one with alpha. I then wrote a shader for cocos2d-x to combine these two textures together at runtime. It was a very simple shader to write.

I’d be happy to answer any other questions about how it was developed.

Various store links:

Google Play

Amazon Appstore

1 Like