bringToFront: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page BringToFront to bringToFront: Converting page titles to lowercase)
No edit summary
 
(3 intermediate revisions by the same user 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 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.
Adjust the z order (or draw order) of the [[Token]] so that is is drawn after 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 front of the other [[Token]]s as it will obscure other [[Token]]s on the same [[Introduction to Mapping#introduction to Mapping|Map Layer]] in the same location.


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
bringToFront()
bringToFront()
bringToFront(id)
bringToFront(tokenRef)
bringToFront(id, mapname)
bringToFront(tokenRef, mapname)
</source>
</syntaxhighlight>
'''Parameter'''
'''Parameter'''
{{param|id|The token {{code|id}} or name of the token to effect, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token to effect, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapname|The name of the map to find the token.  Defaults to the current map.}}
{{param|mapname|The name 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=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight 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>
</syntaxhighlight>




<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
<!-- The Hero of the piece should always stand out -->
<!-- The Hero of the piece should always stand out -->
[h: bringToFront("Hero")]
[h: bringToFront("Hero")]
</source>
</syntaxhighlight>


|also=
|also=

Latest revision as of 20:33, 12 May 2024

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(tokenRef)
bringToFront(tokenRef, mapname)

Parameter

  • tokenRef - Either the token id or Token Name of the token to effect, defaults to the Current Token.

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

  • mapname - The name 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

<!-- 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.
  • 1.5.4 - Added mapname parameter option.