Day #2 : Spritesheet slicer


Today was a great day for this project. Since it was Sunday, I had a lot of time to work on this. First I got a simple file picker working in IsoMapper. Tbh, it was just a matter of searching the correct package on pub.dev. I am not a great fan of adding unnecessary external dependencies to my projects, but implementing a file picker from scratch seemed like an overkill. Also, there was no way I could implement a native file picker for mac without Apple hardware.

Anyways, once I got the file picker working, I started working on displaying the selected image into IsoMapper using Flame's components. I chose to do so because I wanted to draw the tile grid on top of this image and doing it using Flame's APIs felt more natural to me. Had to work out some simple math for deciding the scale of image so that it fills as much area as possible.

For the tile size, I wanted IsoMapper to display grids as soon as user modifies the size parameters. It took more time than I initially thought, but finally I got it working (or so I thought 😅). Since I was using an image with 32x32 px tiles, the code was working even if width and height values were switched. Luckily I got hold of some image assets with rectangular tiles which brought my attention to this issue. Spent some more time making sure that width and height values were actually used as they were supposed to.

Overall, feeling positive about this project😄. 

Get IsoMapper

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.