getTokenFacing: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Initial write-up.)
 
No edit summary
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=getTokenFacing
|name=getTokenFacing
|trusted=true
|trusted=false
|version=1.3b51
|version=1.3b51
|description=
|description=
Gets the facing angle of the token, or {{code|""}} if there is no facing.
Gets the facing angle for the specified or current token.  Default facing is down or -90 degrees.  Zero degrees is along the X-axis to the right.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
getTokenFacing()
getTokenFacing()
</source>
<source lang="mtmacro" line>
getTokenFacing(id)
getTokenFacing(id)
</source>
</source>
'''Parameters'''
'''Parameters'''
* {{code|id}} - The id of the token to get the facing from, defaults to the current token. If this parameter is used, this function requires a trusted macro.
* {{code|id}} - The id of the token to get the facing from, defaults to the current token.{{TrustedParameter}}
'''Returns'''
The angle in degrees or {{code|""}} if no facing has been set


|example=
<source lang="mtmacro" line>
[h: switchToken("Mage")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Elf")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Hero")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Troll")]
[r: token.name]: [r: r = getTokenFacing()]
</source>
'''Returns:'''<br />
[[File:getTokenFacing.png]]
|also=
[[getTokenRotation]]
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 19:29, 1 June 2019

getTokenFacing() Function

Introduced in version 1.3b51
Gets the facing angle for the specified or current token. Default facing is down or -90 degrees. Zero degrees is along the X-axis to the right.

Usage

getTokenFacing()
getTokenFacing(id)

Parameters

  • id - The id of the token to get the facing from, defaults to the current token.

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

Returns The angle in degrees or "" if no facing has been set

Example

[h: switchToken("Mage")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Elf")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Hero")]
[r: token.name]: [r: r = getTokenFacing()]<br>
[h: switchToken("Troll")]
[r: token.name]: [r: r = getTokenFacing()]

Returns:

File:getTokenFacing.png

See Also