Tilemap Flags
The tilemap-flags.png
represents tile collision data. Each tile can be assigned a specific color, and that color corresponds to an ID number flag. The PNG is read in 8x8 pixel chunks, but the first pixel color is used and the others are ignored. When a flag color is detected, the flag’s value is set. Here are the supported flag colors and their corresponding values:
Flag 0 #000000 | Flag 1 #101010 | Flag 2 #202020 | Flag 3 #303030 | Flag 4 #404040 | Flag 5 #505050 | Flag 6 #606060 | Flag 7 #707070 |
Flag 8 #808080 | Flag 9 #8f8f8f | Flag 10 #9f9f9f | Flag 11 #afafaf | Flag 12 #bfbfbf | Flag 13 #cfcfcf | Flag 14 #dfdfdf | Flag 15 #efefef |
The best way to create a collision mask is to overlay the flag colors on the tile map and export them without the tiles in the background so they match up:
It’s important to note that the tile-map.png
needs to match the exact dimensions of the tilemap.png
or they will not work.