goto: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Initial write-up.)
 
No edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
goto(token)
goto(token)
</source>
</syntaxhighlight>
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
goto(x, y)
goto(x, y)
</source>
</syntaxhighlight>
<syntaxhighlight lang="mtmacro" line>
goto(x, y, units)
</syntaxhighlight>
 
'''Parameters'''
'''Parameters'''
* {{code|token}} - The id of the token to center the map to.
* {{code|token}} - The id of the token to center the map to.
* {{code|x}} - The X coordinate of the grid cell to center the map to.
* {{code|x}} - The X coordinate of the grid cell to center the map to.
* {{code|y}} - The Y coordinate of the grid cell to center the map to.
* {{code|y}} - The Y coordinate of the grid cell to center the map to.
* {{code|units}} - goto() defaults to using grid cell coordinates for X and Y. Adding a third parameter - whether it is 0 or 1 - will change that to pixels.
|also=
{{func|moveToken}},
{{func|getTokenY}},
{{func|getZoom}},
{{func|setZoom}}.


}}
}}
[[Category:Miscellaneous Function]]
[[Category:Miscellaneous Function]]

Latest revision as of 15:59, 15 March 2023

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

goto() Function

Introduced in version 1.3b51
Centers the map on a token, or on a specified grid cell.

Usage

goto(token)
goto(x, y)
goto(x, y, units)

Parameters

  • token - The id of the token to center the map to.
  • x - The X coordinate of the grid cell to center the map to.
  • y - The Y coordinate of the grid cell to center the map to.
  • units - goto() defaults to using grid cell coordinates for X and Y. Adding a third parameter - whether it is 0 or 1 - will change that to pixels.


See Also