Pointless Tips: Cocos2D PList textureImageData

Insider 22 Aug , 2019 0

It may happen that a Cocos2D Plist file (for instance, one used by the particle system) to embed the texture data in a textureImageData field. It may so happen that you want to extact this into an actual image.

textureImageData is a Base64 zipped png 😀

If you have access to bash (on a Linux, MinGW or Cygwin), here’s the one-liner to get your image:

echo Copy/Paste Here the Base64 encoded string from textureImageData | base64 --decode | gunzip -c - > result.png

Or, if the Base64 encoded string is too incovenient to paste in the terminal, create a file out of it and:

echo textureImageData.txt | base64 --decode | gunzip -c - > result.png

Otherwise, you may use an online tool to decode Base64, then open the archive with 7zip. Works just as well.

Written by
Stefan Dicu
Owner of Piron Games and game developer.

LEAVE A REPLY

Your email address will not be published.