
If you like, you can take a look at the source code for this at http://pasteall.org/2333/python. However, it must be noted that the code is uncommented and incredibly messy, so I wouldn't advise trying to understand it.
The basic scaling algorithm is as follows:
Mx = Mouse x-position
My = Mouse y-position
Cx = Centre of the tile (x-axis)
Cy = Centre of the tile (y-axis)
Tx = Tile size (x-axis)
Ty = Tile size (y-axis)

Click on the image to view it full-size as always.
As you can see, the scale factor must be in range 1.0 <= x <= 2.0, so it's necessary to also add code that clips the scale factor at these values.
This is probably going to get a lot more complicated when I add scrolling...
Anyway, that's all for this update. Watch this space for more soon!
No comments:
Post a Comment