getTokenFacing: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 10: Line 10:
getTokenFacing()
getTokenFacing()
getTokenFacing(id)
getTokenFacing(id)
getTokenFacing(id, mapname)
</source>
</source>
'''Parameters'''
'''Parameters'''
* {{code|id}} - The id of the token to get the facing from, defaults to the current token.{{TrustedParameter}}
* {{param|id|The id of the token to get the facing from, defaults to the current token.}}{{TrustedParameter}}
{{param|mapname|The name of the map to find the token.  Defaults to the current map.}}
 
'''Returns'''
'''Returns'''
The angle in degrees or {{code|""}} if no facing has been set
The angle in degrees or {{code|""}} if no facing has been set
Line 31: Line 34:
|also=
|also=
[[getTokenRotation]]
[[getTokenRotation]]
|changes=
{{change|1.5.4|Added {{code|mapname}} parameter option.}}
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 20:42, 15 August 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)
getTokenFacing(id, mapname)

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

  • mapname - The name of the map to find the token. Defaults to the current map.

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

Version Changes

  • 1.5.4 - Added mapname parameter option.