setViewArea: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page SetViewArea to setViewArea: Converting page titles to lowercase) |
No edit summary |
||
Line 6: | Line 6: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
setViewArea(startX, startY, endX, endY [, pixels [, allPlayers]]) | setViewArea(startX, startY, endX, endY [, pixels [, allPlayers]]) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
Line 21: | Line 21: | ||
|examples= | |examples= | ||
Set the viewport of the current client such that it at least sees the corners of the area with the following CELL coordinates: | Set the viewport of the current client such that it at least sees the corners of the area with the following CELL coordinates: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:setViewArea(0,0,30,20, 0)] | [h:setViewArea(0,0,30,20, 0)] | ||
</ | </syntaxhighlight> | ||
When the GM runs the macro change the viewport in PIXEL coordinates on ALL clients, else only on the current client: | When the GM runs the macro change the viewport in PIXEL coordinates on ALL clients, else only on the current client: | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h:setViewArea(0, 0, 300, 200, 1, isGM())] | [h:setViewArea(0, 0, 300, 200, 1, isGM())] | ||
</ | </syntaxhighlight> | ||
Latest revision as of 17:47, 14 March 2023
setViewArea() Function
• Introduced in version 1.5
Sets the viewed screen area for the current map using two sets of cell coordinates, so that the two cells are at the edge of the screen. If the map is "gridless", the coordinates will be pixel coordinates. A final optional parameter causes the view of any connected players to be set the same. Only GMs or trusted macros can trigger the view of all players to change.
Usage
setViewArea(startX, startY, endX, endY [, pixels [, allPlayers]])
Parameters
startX
- the x coordinate of the cell that will mark the upper left corner of the displayed area.startY
- the y coordinate of the cell that will mark the upper left corner of the displayed area.endX
- the x coordinate of the cell that will mark the lower right corner of the displayed area.endY
- the x coordinate of the cell that will mark the lower right corner of the displayed areapixels
- an optional parameter that if set to true (1) means the coordinates are measured in pixels. If set to false (0) the coordinates are measured in map cells. Defaults to true (1).allPlayers
- Optional: If set to true (1) and called from a trusted macro, all players views will be set. Defaults to 0. This will change the player clients to be on the same map as that of the client executing the macro.
Examples
Set the viewport of the current client such that it at least sees the corners of the area with the following CELL coordinates:
[h:setViewArea(0,0,30,20, 0)]
When the GM runs the macro change the viewport in PIXEL coordinates on ALL clients, else only on the current client:
[h:setViewArea(0, 0, 300, 200, 1, isGM())]