Both the level and simultaneous tileset zoomed to 32 pixels per tile |
Various technical articles, IT-related tutorials, software information, and development journals
Sunday, April 15, 2018
FMod - Zoomable simultaneous tileset
Today I decided to finally implement zoom for Abiathar's simultaneous tileset. I started by defining a new, smaller set of zoom levels, since any zoom factor bigger than 2x would make the tileset cover virtually the entire screen, which defeats the purpose of it being a simultaneous tileset. Then I did some math to make the appropriate UI elements get resized and relocated correctly when the tileset zoom level changes. Finally, I had to go through and replace all the assumptions of 16 pixels per tile in the simultaneous tileset with uses of the new tileset-specific zoom level. This was probably the trickiest part, since the 16 assumption had made its way around in the four years of Abiathar's existence. Fortunately I think I've got it all - a search for "16" in the main form's code turns up only things that legitimately need to be hardcoded as 16.
The zoom slider had to go - it wouldn't make sense to have a single zoom slider and two separate zoom levels - but I kept the zoom status label. In simultaneous tileset mode, it displays the two zoom levels as e.g. "100%, 200%" for the level being at 1x and the tileset being at 2x. Possibly confusingly, the Zoom In and Zoom Out menu items only control the main zoom; the only way to change the zoom level of the simultaneous tileset is to mouse over it and use the plus or minus keys. I may need to reconsider that based on user feedback.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment