moveTokenToMap: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
moveTokenToMap( | moveTokenToMap(tokenRef, map) | ||
moveTokenToMap( | moveTokenToMap(tokenRef, map, x) | ||
moveTokenToMap( | moveTokenToMap(tokenRef, map, x, y) | ||
moveTokenToMap( | moveTokenToMap(tokenRef, map, x, y, z) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param| | {{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token or a [[JSON Array]] of token {{code|id}}s of the token/s to move.}} | ||
{{param|map|A string containing the name of the map that the token is moved to.}} | {{param|map|A string containing the name of the map that the token is moved to.}} | ||
{{param|x|The {{code|X}} coordinate of the map that the token should be moved to. Default to 0.}} | {{param|x|The {{code|X}} coordinate of the map that the token should be moved to. Default to 0.}} | ||
{{param|y|The {{code|Y}} coordinate of the map that the token should be moved to. Default to 0.}} | {{param|y|The {{code|Y}} coordinate of the map that the token should be moved to. Default to 0.}} | ||
{{param|z|The z-order that the token should have after being moved. Defaults to the largest of the map.}} | {{param|z|The z-order that the token should have after being moved. Defaults to the largest of the map.}} | ||
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}} | |||
|also= | |also= | ||
Line 25: | Line 26: | ||
}} | }} | ||
[[Category:Token Function]] | [[Category:Token Function]][[Category:Map Function]] |
Latest revision as of 23:59, 17 May 2024
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
This article needs: Examples of usage, and clearer description.
moveTokenToMap() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.3b54
Moves tokens from the current map to a specified map.
Usage
moveTokenToMap(tokenRef, map)
moveTokenToMap(tokenRef, map, x)
moveTokenToMap(tokenRef, map, x, y)
moveTokenToMap(tokenRef, map, x, y, z)
Parameters
tokenRef
- Either the tokenid
or Token Name of the token or a JSON Array of tokenid
s of the token/s to move.map
- A string containing the name of the map that the token is moved to.x
- TheX
coordinate of the map that the token should be moved to. Default to 0.y
- TheY
coordinate of the map that the token should be moved to. Default to 0.z
- The z-order that the token should have after being moved. Defaults to the largest of the map.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.