View command, for images, should support zooming in/out with +/~
The view command currently draws images at 1:1 size. This can be too big or small to clearly see the image. Add the use of + and - to zoom in and out by a factor of sqrt(2).
In the case of viewing a tileset, don't change the size of the numbers drawn; only change where they are drawn to match the scaled image.
This code is in startup.ms. Your workflow will look like this:
- Clone this repo
- In Mini Micro, mount the sys folder in slot 1
-
edit "startup"(or use an external editor) - run it (from the editor, or the
run "startup"command) - Test the
viewcommand - Goto 3 until done
For a recent example of why this would be useful, see this blog post. It uses this tile set image:
But because the tiles are only 8x8 pixels, I couldn't use the view command to usefully display the tile indexes. I had to use a drawing program and manually label all 88 tiles! It was a pain.
With this new feature, we'll be able to view those indexes right within Mini Micro by doing this:
display(5).mode = displayMode.tile
td = display(5)
td.tileSet = file.loadImage("dk_tiles.png") // or whatever we called the above image
td.tileSetTileSize = 8
view td.tileSet
...and then zooming in until it's legible.