sendToBack: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Added version.) |
No edit summary |
||
(10 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
|version=1.3b48 | |version=1.3b48 | ||
|description= | |description= | ||
Adjust the z-order (or draw order) of the [[Token]] so that it is drawn before all other [[Token]]s on the same [[Introduction to Mapping#introduction to Mapping|Map Layer]], this has the effect of making the Token appear to be in back of the other [[Token]]s as it will be obscured by other [[Token]]s on the same [[Introduction to Mapping#introduction to Mapping|Map Layer]] in the same location. | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
sendToBack() | sendToBack() | ||
</ | sendToBack(tokenRef) | ||
sendToBack(tokenRef, mapRef) | |||
</syntaxhighlight> | |||
'''Parameter''' | |||
{{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token that has its z-order changed, defaults to the [[Current Token]]. {{TrustedParameter}} }} | |||
{{param|mapRef|The Name or ID of the map to find the token. Defaults to the current 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.}} | |||
|examples= | |||
Sends the [[Current Token]] to the lowest z-order. | |||
<syntaxhighlight lang="mtmacro" line> | |||
[h: sendToBack()] | |||
</syntaxhighlight> | |||
Sends all of the selected tokens to the lowest z-order. | |||
<syntaxhighlight lang="mtmacro" line> | |||
[h: tokens = getSelected()] | |||
[h, foreach(id, tokens, ""), code: | |||
{ | |||
[h: sendToBack(id)] | |||
}] | |||
</syntaxhighlight> | |||
|also= | |||
{{func|bringToFront}} | |||
|changes= | |||
{{change|1.3b51|Added {{code|id}} parameter option.}} | |||
{{change|1.5.4|Added {{code|mapname}} parameter option.}} | |||
}} | }} | ||
[[Category:Token Function]] | [[Category:Token Function]] |
Latest revision as of 23:59, 23 May 2024
sendToBack() Function
• Introduced in version 1.3b48
Adjust the z-order (or draw order) of the Token so that it is drawn before all other Tokens on the same Map Layer, this has the effect of making the Token appear to be in back of the other Tokens as it will be obscured by other Tokens on the same Map Layer in the same location.
Usage
sendToBack()
sendToBack(tokenRef)
sendToBack(tokenRef, mapRef)
Parameter
tokenRef
- Either the tokenid
or Token Name of the token that has its z-order changed, 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.
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.
Examples
Sends the Current Token to the lowest z-order.
[h: sendToBack()]
Sends all of the selected tokens to the lowest z-order.
[h: tokens = getSelected()]
[h, foreach(id, tokens, ""), code:
{
[h: sendToBack(id)]
}]
See Also
Version Changes
- 1.3b51 - Added
id
parameter option. - 1.5.4 - Added
mapname
parameter option.