Posts

Cocos2d-X v3.x : Calling Functions after Delay

Image
I had been facing some issue with calling functions after some delay.  So there have been syntax changes happening in cocos2dx, because of which it was a bit difficult to find out which one was the correct approach. I finally got the below sequence to work:    float   delay =  2.0f;   auto delayAction = DelayTime ::create(delay);    // For 2 Seconds of Delay     auto  funcCallback = CallFunc ::create([](){          // Add Your Code Here!         // If you want, you can call other functions from here as well     });    this ->runAction( Sequence ::create(delayAction, funcCallback, NULL )); Though initially I didn't like integrating a function within the code (known as lambda function), I realised this made life simpler by removing cumbersome selector calls, where you had to remember separate calls based on what kinds of arguments need to be passed. ...

Supporting Unicode and Emoji characters in Unity3D (or other Engine) Game - The Lazy Way

Image
Recently I had been working on a client project. Most of their targeted customers were not English speakers. As a result, they wanted to support multiple languages in their games. If that was not enough, they also wanted to support Emoji's in there. We were developing their game on Unity3D. Most of the game's actions were validated and executed on the backend, which was configured on LAMP [Linux, Apache, MySQL and PHP]. By the time this issue was raised, most of the work was already done. The Database structure and the game data was already populated. The Mess A quick search on Google was enough to confuse you even more. Turns out, Unicode characters can be supported by various encodings like UTF8 & UTF16. Add to that, there are multiple versions of UTF8. And there are multiple versions like UTF-8, CESU8, UTF-8 modified. And then there was MySQL which has its own sets of character encoding. MySQL supports UTF-8. But if you also want to use Emoji, you need to use a s...