getViewArea: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:


'''Parameters'''
'''Parameters'''
* {{code|pixels}} - if set to true (1) means the returned coordinates are measured in pixels. If set to false (0) the returned coordinates are measured in map cells.
* {{code|pixels}} - if set to true (1) means the returned coordinates are measured in pixels. If set to false (0) the returned coordinates are measured in map cells. Defaults to {{code|true}}.


|examples=
|examples=
Line 25: Line 25:


|also=
|also=
{{func|setViewArea}},
{{func|setViewArea}}, {{func|goto}}, {{func|setZoom}}, {{func|getZoom}}.  
{{func|goto}},
 
{{func|setZoom}},
{{func|getZoom}}.
}}
}}
[[Category:Miscellaneous Function]]
[[Category:Miscellaneous Function]]

Revision as of 13:43, 17 March 2019

getViewArea() Function

Introduced in version 1.5.0
Returns the limits of the visible area of the map window, given in either pixels or cell coordinates depending on the first parameter.

Usage

getViewArea(pixels)

Parameters

  • pixels - if set to true (1) means the returned coordinates are measured in pixels. If set to false (0) the returned coordinates are measured in map cells. Defaults to true.

Examples

Get the viewport dimensions of the current client in cells:
[h:getViewArea(0)]

Get the viewport dimensions of the current client in pixels:

[h:getViewArea(1)]

See Also