sendToBack: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Updated with recent version changes.)
(Added examples, filling stub requirement.)
Line 1: Line 1:
{{stub|Examples of usage.}}
{{MacroFunction
{{MacroFunction
|name=sendToBack
|name=sendToBack
Line 15: Line 14:
'''Parameter'''
'''Parameter'''
{{param|id|The token {{code|id}} or name of the token that has its z-order changed, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|id|The token {{code|id}} or name of the token that has its z-order changed, defaults to the [[Current Token]]. {{TrustedParameter}} }}
|examples=
Sends the [[Current Token]] to the lowest z-order.
<source lang="mtmacro" line>
[h: sendToBack()]
</source>
Sends all of the selected tokens to the lowest z-order.
<source lang="mtmacro" line>
[h: tokens = getSelected()]
[h, foreach(id, tokens, ""), code:
{
    [h: sendToBack(id)]
}]
</source>


|also=
|also=

Revision as of 01:00, 16 April 2009

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(id)

Parameter

  • id - The token id or 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

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.