getHalo: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function getHalo== Gets the value of the specified Token:halo for the Token:token. The value returned is a string that represents the hexadecimal value of the color of the halo...)
 
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Function getHalo==
{{MacroFunction
Gets the value of the specified [[Token:halo|halo]] for the [[Token:token|token]]. The value returned is a string that represents the hexadecimal value of the color of the halo in the format #''RRGGBB'' or "None" if there is no [[Token:halo|].
|name=getHalo
===Usage===
|version=1.3b49
<source lang="mtmacro" line>
|description=Gets the color value of a token's [[Halo]]. The value returned is a string that represents the hexadecimal value of the color of the [[Halo]] in the format {{code|"#RRGGBB"}} or {{code|"None"}} if the token has no [[Halo]].
[h: color = getHalo()]
</source>


===Examples===
|usage=
The following example will display the text "Halo Color Text" in the color of the [[Token:halo|token's halo]].
<syntaxhighlight lang="mtmacro" line>
<source lang="mtmacro" line>
getHalo()
</syntaxhighlight>
<syntaxhighlight lang="mtmacro" line>
getHalo(tokenRef)
</syntaxhighlight>
'''Parameter'''
{{param|tokenRef|getHalo which has its halo color returned, defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{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.}}
 
|example=
The following example will display the text "Halo Color Text" in the color of the [[Current Token]]'s [[Halo]].
<syntaxhighlight lang="mtmacro" line>
<span style="color:[r: getHalo()]">Halo Color Text</span>
<span style="color:[r: getHalo()]">Halo Color Text</span>
</source>
</syntaxhighlight>
 
|also=
[[Halo]],
[[setHalo|setHalo()]]
 
|changes=
{{change|1.3b51|Added {{code|id}} parameter option.}}
}}
[[Category:Token Function]]

Latest revision as of 02:59, 13 May 2024

getHalo() Function

Introduced in version 1.3b49
Gets the color value of a token's Halo. The value returned is a string that represents the hexadecimal value of the color of the Halo in the format "#RRGGBB" or "None" if the token has no Halo.

Usage

getHalo()
getHalo(tokenRef)

Parameter

  • tokenRef - getHalo which has its halo color returned, defaults to the Current Token.

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

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.

Example

The following example will display the text "Halo Color Text" in the color of the Current Token's Halo.
<span style="color:[r: getHalo()]">Halo Color Text</span>

See Also

Version Changes

  • 1.3b51 - Added id parameter option.