From RPTools Wiki
Jump to navigation Jump to search

setZoom() Function

Introduced in version 1.4
Sets the zoom level of the viewport in percentages, where 1 (=100%) is the default.




  • z - The zoom level of the viewport (the current zoom level can be seen at the bottom of the maptool screen. You can also use getZoom(). Note that this value is given in the numerical representation of %. E.g. to set zoom to 50% you give 0.5 as parameter.


Zoom in by a factor 2
[h: z = getZoom()]
[h: setZoom(2*z)]

Zoom in by one 10%

[h: z = getZoom()]
[h: setZoom(z+0.1)]

Zoom out by 10%

[h: z = getZoom()]
[h: setZoom(z-0.1)]

See Also