setSize: Difference between revisions

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


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setSize(size)
setSize(size)
setSize(size, id)
setSize(size, id)
setSize(size, id, mapname)
setSize(size, id, mapname)
</source>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
{{param|size|A [[Token Size]] to set the token to. Can be "Free" or "Native" as well.}}
{{param|size|A [[Token Size]] to set the token to. Can be "Free" or "Native" as well.}}
Line 19: Line 19:
|examples=
|examples=
To set the size of the current token to {{code|Medium}}:
To set the size of the current token to {{code|Medium}}:
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: setSize("Medium")]
[h: setSize("Medium")]
</source>
</syntaxhighlight>


To set the size of the current token to whatever string is stored in the macro variable '''mySize''':
To set the size of the current token to whatever string is stored in the macro variable '''mySize''':
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: mySize = "Large"]
[h: mySize = "Large"]
[h: setSize(mySize)]
[h: setSize(mySize)]
</source>
</syntaxhighlight>


|also=
|also=

Revision as of 20:34, 14 March 2023

setSize() Function

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

Introduced in version 1.3b48
Sets the size of a Token with one of the defined sizes according to each Grid Type. The sizes can be found on the Token Size page. "Free" or "Native" are also valid values.

Usage

setSize(size)
setSize(size, id)
setSize(size, id, mapname)

Parameters

  • size - A Token Size to set the token to. Can be "Free" or "Native" as well.
  • id - The token id of the token which will have its Token Size set. Defaults to the Current Token.
  • mapname - The name of the map to find the token. Defaults to the current map.

Examples

To set the size of the current token to Medium:
[h: setSize("Medium")]

To set the size of the current token to whatever string is stored in the macro variable mySize:

[h: mySize = "Large"]
[h: setSize(mySize)]

See Also

Version Changes

  • 1.3b51 - Added id parameter option.
  • 1.5.4 - Added mapname parameter option.