flackr / dungeon

A D&D based multiplayer role playing game.
13 stars 4 forks source link

Add an interface for zooming #4

Closed flackr closed 12 years ago

flackr commented 12 years ago

Summary

The game currently supports drawing at an arbitrary size. We just need to hook up a way for the user to actually adjust that size, probably by using the scroll wheel or worst case pressing +/- buttons.

Implementation

The size of a tile is called tileSize in dungeon-client.js. The UI just needs to change that value and call update to redraw. Don't use fractional tile sizes (i.e. 30.5) as these will not draw well on the canvas and are far less efficient. Scaling images to an arbitrary integer tile size is always okay though.