setViewArea: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=setViewArea |version=1.4 |description= Sets the currently viewed screen area, set by two cell coordinates, so that the two cells are at the edge of the scre...")
 
No edit summary
Line 14: Line 14:
* {{code|startY}} - the y coordinate of the cell that will mark the upper left corner of the displayed area.
* {{code|startY}} - the y coordinate of the cell that will mark the upper left corner of the displayed area.
* {{code|endX}} - the x coordinate of the cell that will mark the lower right corner of the displayed area.
* {{code|endX}} - the x coordinate of the cell that will mark the lower right corner of the displayed area.
* {{code|endYv - the x coordinate of the cell that will mark the lower right corner of the displayed area
* {{code|endY}} - the x coordinate of the cell that will mark the lower right corner of the displayed area
* {{code|allPlayers}} - Optional: If set to true (1) and called from a trusted macro, all players views will be set. Defaults to 0
* {{code|allPlayers}} - Optional: If set to true (1) and called from a trusted macro, all players views will be set. Defaults to 0



Revision as of 21:23, 3 May 2015

setViewArea() Function

Introduced in version 1.4
Sets the currently viewed screen area, set by two 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 [,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 area
  • allPlayers - Optional: If set to true (1) and called from a trusted macro, all players views will be set. Defaults to 0

Examples

Set the viewport of the current client such that it at least sees the corners of the area with the following coordinates:
[h:setViewArea(0,0,30,20)]

When the GM runs the macro change the viewport on ALL clients, else only on the current client:

[h:setViewArea(0,0,30,20,isGM())]

See Also