bringToFront: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Added details for the function)
m (Minor formatting changes.)
Line 2: Line 2:
|name=bringToFront
|name=bringToFront
|version=1.3b48
|version=1.3b48
|description=Adjust the z order (or draw order) of the [[Token:token|token]] so that is is drawn after all other [[Token:token|token]]s on the
|description=
same [[Map:map layer|map layer]], this has the effect of making the [[Token:token|token]] appear to be in front of the other
Adjust the z order (or draw order) of the [[Token]] so that is is drawn after all other [[Token]]s on the same [[Map Layer]], this has the effect of making the [[Token]] appear to be in front of the other [[Token]]s as it will obscure other [[Token]]s on the same [[Map Layer]] in the same location.
[[Token:token|token]]s as it will obscure other [[Token:token|token]]s on the same [[Map:map layer|map layer]] in the same location.


|usage=
|usage=
Line 13: Line 12:
bringToFront(id)
bringToFront(id)
</source>
</source>
'''Parameter'''
'''Parameter'''
{{param|id|The id or name of the token to effect. Can only be used when running from a [[Trusted Macro]].}}
{{param|id|The token {{code|id}} or name of the token to effect, defaults to the [[Current Token]]. {{TrustedParameter}} }}


|example=
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
<!-- Make sure that we are visible above all other tokens on the same layer -->
<!-- Make sure that we are visible above all other tokens on the same layer -->
[h: bringToFront()]
[h: bringToFront()]
</source>
</source>




Line 30: Line 27:
</source>
</source>


|also=
[[sendToBack|sendToBack()]]


|changes=
|changes=
{{change|1.3b51|Added optional {{code|id}} parameter.}}
{{change|1.3b51|Added {{code|id}} parameter option.}}
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 04:44, 31 March 2009

bringToFront() Function

Introduced in version 1.3b48
Adjust the z order (or draw order) of the Token so that is is drawn after all other Tokens on the same Map Layer, this has the effect of making the Token appear to be in front of the other Tokens as it will obscure other Tokens on the same Map Layer in the same location.

Usage

bringToFront()
bringToFront(id)

Parameter

  • id - The token id or name of the token to effect, defaults to the Current Token.

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

Examples

<!-- Make sure that we are visible above all other tokens on the same layer -->
[h: bringToFront()]


<!-- The Hero of the piece should always stand out -->
[h: bringToFront("Hero")]

See Also

Version Changes

  • 1.3b51 - Added id parameter option.