setZoom: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:
* {{code|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 {{func|getZoom}}
* {{code|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 {{func|getZoom}}


|example=
|examples=
Zoom in by a factor 2
Zoom in by a factor 2
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: z = getZoom()]
[h: z = getZoom()]
[h: setZoom(2*z)]
[h: setZoom(2*z)]
</source>
Zoom in by one step
<source lang="mtmacro" line>
[h: z = getZoom()]
[h: setZoom(z+1)]
</source>
Zoom out by one step
<source lang="mtmacro" line>
[h: z = getZoom()]
[h: setZoom(z-1)]
</source>
</source>



Revision as of 08:37, 30 April 2015

setZoom() Function

Introduced in version 1.4
Sets the zoom level of the viewport.

Usage

setZoom(z)

Parameters

  • 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()

Examples

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

Zoom in by one step

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

Zoom out by one step

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

See Also