Wrapping Up The New Draw Tool

This past week I focused on some of Pixel Vision 8's less glamorous features that seriously needed updating. Luckily these mark the end of the new Draw Tool's functionality, so all that is left to do is fix the major bugs. Here is a summary of the two new features.

Edit Mask Color
The mask color is what PV8's parser uses to determine transparency when loading up a sprite. By default, the engine uses magenta (#FF00FF). While the option to change this has always existed, it wasn't accessible in any of the tools. After working on this new CGA art pack, it was clear that using the default mask color wasn't going to work since it was too similar to an existing color. So I changed it to a bright green (#00FF00). Of course, this broke the parser, so I added the following new menu option:

As you can see, the sprites are initially a solid color with no transparency, but once I change the mask color and re-parse the sprites, they show up correctly. This is a small feature, but one that could help people working on pixel art outside of PV8.

Sprite Builder
There has been an undocumented feature in the Sprite Tool since day one called the Sprite Builder. It looks for a folder in your project and compares the png files against what is in memory. Each png file has a unique variable name and reference to any matching sprites. The exported file allows you to draw larger sprites by name, and it's how all of the UI works. Last week, I rebuilt the tool to run entirely in Lua, and now you can supply different templates.

All you have to do is create a folder called SpriteBuilder in your project and add your png files that use the same sprites and colors like the ones found in the sprites.png file. 

I've built two new templates that allow you to use the new Meta Sprite API. The new JSON file is loaded up automatically when a project runs, and the other Lua template can be manually loaded at runtime for extra control over when the Meta Sprites are instantiated. Eventually, there will be a dedicated Meta Sprite Tool that will let you build your own and create animations.

That is it for this week's update. Unfortunately, with all of these changes, I accidentally broke the tilemap editor. So, I'll be taking the opportunity to update its code over the next few days to leverage the new components I've written. Once this is working, it should be smooth sailing towards the next major release!