setTokenWidth: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 5: | Line 5: | ||
|version=1.3b91 | |version=1.3b91 | ||
|description= | |description= | ||
Sets the token's image width in pixels (boundary size). | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
setTokenWidth(size) | |||
setTokenWidth(size, id) | setTokenWidth(size, id) | ||
</ | setTokenWidth(size, id, mapRef) | ||
</syntaxhighlight> | |||
'''Parameters''' | '''Parameters''' | ||
{{param|size|grid size of the token}} | {{param|size|grid size of the token}} | ||
{{param|id|The token id of the token to set its width}} | {{param|id|The token {{code|id}} of the token to set its width. Defaults to the [[Current_Token|Current Token]].}}{{TrustedParameter}} | ||
{{param|mapRef|The Name or ID of the map to find the token. Defaults to the current map.}} | |||
|example= | |example= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: setTokenWidth(300, "Dragon")] | [r: setTokenWidth(300, "Dragon")] | ||
[r: setTokenHeight(150, "Dragon")] | [r: setTokenHeight(150, "Dragon")] | ||
</ | </syntaxhighlight> | ||
|changes= | |||
{{change|1.5.4|Added {{code|mapname}} parameter option.}} | |||
|also= | |also= | ||
{{func|setTokenHeight}}, | {{func|setTokenHeight}}, {{func|getTokenHeight}}, {{func|getTokenWidth}} | ||
{{func|getTokenHeight}}, | |||
{{func|getTokenWidth}} | |||
}} | }} | ||
[[Category:Token Function]] | [[Category:Token Function]] |
Latest revision as of 23:59, 14 March 2023
setTokenWidth() Function
• Introduced in version 1.3b91
Sets the token's image width in pixels (boundary size).
Usage
setTokenWidth(size)
setTokenWidth(size, id)
setTokenWidth(size, id, mapRef)
Parameters
size
- grid size of the tokenid
- The tokenid
of the token to set its width. Defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapRef
- The Name or ID of the map to find the token. Defaults to the current map.
Example
[r: setTokenWidth(300, "Dragon")]
[r: setTokenHeight(150, "Dragon")]
See Also
Version Changes
- 1.5.4 - Added
mapname
parameter option.