My first draft of the bodypaint generator was a bit hacky, so I went back and cleaned it up a bit.
The placing feature was mixed in with the top-level generator object. I split it out to its own class, so I could make sub-classes and switch out or combine placers on one canvas just like I could use any combination of “drawers” with one placer. To demonstrate the new placer’s extensibility, I implemented a grid placer in addition to the random placer I made earlier.
Finally I made some quality-of-life improvements to make testing easier for myself.
- A “regenerate” button so I can re-run the generator without re-loading the page.
- A “save to PNG” button so I don’t have to Print-Screen, paste into an image editor, and crop each time I want to add an image to my blog. (If you look carefully at previous entries about this program, the images are off by a few pixels.)