resetSize: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page ResetSize to resetSize: Converting page titles to lowercase)
No edit summary
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
resetSize()
resetSize()
resetSize(id)
resetSize(id)
resetSize(id, mapname)
resetSize(id, mapname)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|id|The token {{code|id}} of the token to reset, defaults to the [[Current Token]].}}
{{param|id|The token {{code|id}} of the token to reset, defaults to the [[Current Token]].}}
Line 18: Line 18:
|examples=
|examples=
To reset the size of the current token to the default for the map:
To reset the size of the current token to the default for the map:
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: resetSize()]
[h: resetSize()]
</source>
</syntaxhighlight>


To reset the size of token '''Chocolate Moose''' on map '''Cadbury''':
To reset the size of token '''Chocolate Moose''' on map '''Cadbury''':
<source lang="mtmacro" line>
<soursyntaxhighlight ce lang="mtmacro" line>
[h: tok = "Chocolate Moose"]
[h: tok = "Chocolate Moose"]
[h: map = "Cadbury"]
[h: map = "Cadbury"]
[h: resetSize(tok, map)]
[h: resetSize(tok, map)]
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 22:10, 14 March 2023

resetSize() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.3b48
Resets the Size of a Token to the default for grid type of the map it occupies. See setSize() for details about the default size for different grid types.

Usage

resetSize()
resetSize(id)
resetSize(id, mapname)

Parameters

  • id - The token id of the token to reset, defaults to the Current Token.
  • mapName - Optional map name to find the token. Defaults to current map.

Examples

To reset the size of the current token to the default for the map:
[h: resetSize()]

To reset the size of token Chocolate Moose on map Cadbury: <soursyntaxhighlight ce lang="mtmacro" line> [h: tok = "Chocolate Moose"] [h: map = "Cadbury"] [h: resetSize(tok, map)]

</syntaxhighlight>

See Also

Version Changes

  • 1.5.4 - Added mapName parameter option.