User Tools

Site Tools


Action disabled: recent
midres_library:tutorial:mctile:generating_tiles
Translations of this page:


TUTORIAL: MULTICOLOR TILE

GENERATING TILES

So make sure that the image has a homogeneous white color (0xffffff) on the bottom of the eyes and a black (0x000000) on the background. At this point, save the image by exporting it as a PNG with the name mctile_ghost.png. Now you must create a completely black image, still 16×16 pixels, and save it as mctile_empty.png.

Now you must call the img2tile program with the following command line (please correct the paths accordingly with your configuration):

img2tile -v -m -i mctile_empty.png -i mctile_ghost.png -o tutorial_mctile.bin -g tutorial_mctile.h

This command has the following meaning:

  1. -v verbose (“write explictly what you do”);
  2. -m enable multicolor support;
  3. -i mctile_empty.png indicates the first file to insert in the tileset;
  4. -i mctile_ghost.png indicates the second file to add to the tileset;
  5. -o tutorial_mctile.bin indicates the file where the multicolor tileset will be saved;
  6. -g tutorial_mctile.h indicates the include file, which is needed for compilation.

Running the program displays a series of numbers, which represent the index chosen by the program for each color of the generated images. The choice depends on the order in which the tile pixels are presented.

In the example produced, the first color (index 0) is black and is that of the background. The second color (index 1) is red and is that of the ghost's “dress”. The third color (index 2) is white, and is the background of the eyes. Finally, the last (index 3) is the color of the inside of the eyes.

  Return to tutorial.