Sets the currently viewed screen area, set by two pixel or cell coordinates, so that the two points are at the edge of the screen. By default or if the map is "gridless", the coordinates will be pixel coordinates. If the optional "pixels" parameter is set to false, the coordinates will be measured in map cells. 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
Code: Select all
setViewArea(startX, startY, endX, endY [, pixels [, allPlayers]])
- startX - the x coordinate of the pixel or cell that will mark the upper left corner of the displayed area.
- startY - the y coordinate of the pixel or cell that will mark the upper left corner of the displayed area.
- endX - the x coordinate of the pixel or cell that will mark the lower right corner of the displayed area.
- endY - the x coordinate of the pixel or cell that will mark the lower right corner of the displayed area
- pixels - 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 - an optional parameter that if set to true (1) and called from a trusted macro, all players views will be set. Defaults to false (0).
Code: Select all
[h:setViewArea(0,0,1500,1000)]
Code: Select all
[h:setViewArea(0,0,30,20,0,isGM())]