Thursday, July 21, 2005

Thursday 21st

A nice email arrived this morning, with another snippet of code from Muttley; I'd hit a snag with my Tile padding routine, so rather than waste precious time trying every possibility I asked Muttley to explore the problem. It all boiled down to the fact that I was using AnimImages, which produce quirky results when the image is written to.

After a few tweaks, the code was working correctly, albeit with a slight snag - the padding routine creates an Image, not an AnimImage, so none of my Editor code could display the tiles properly. I considered that if a tileset was too short, the user would probably want to save the corrected Tileset anyway, so I got around the problem by saving the corrected Tileset (for future use), then loading it back in as an AnimImage.

Hit upon the notion that Tilesets might also contain too many tiles; thankfully, the padding routine also automatically crops larger images, so the addition of a simple check at the start of the routine now means that over and undersized Tilesets are catered for! :)

Also took the opportunity of adding an Export Tileset function; currently, the Editor can handle either continuous strips of tiles, or images which hold a block of tiles - the Export function now allows tiles loaded as blocks to be saved out as strips.