js:Token: Difference between revisions
No edit summary |
|||
Line 9: | Line 9: | ||
Returns the notes field of the token. | Returns the notes field of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getNotes(); | token.getNotes(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 21: | Line 21: | ||
Sets the notes field of the token. | Sets the notes field of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.setNotes(newNotes); | token.setNotes(newNotes); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 33: | Line 33: | ||
Returns the name of the token. | Returns the name of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getName(); | token.getName(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 45: | Line 45: | ||
Sets the name of the token | Sets the name of the token | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.setName(newName); | token.setName(newName); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 57: | Line 57: | ||
Returns true if sight is enabled for the token | Returns true if sight is enabled for the token | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.hasSight(); | token.hasSight(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 69: | Line 69: | ||
Returns the maptool ID of the token. | Returns the maptool ID of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getId(); | token.getId(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 81: | Line 81: | ||
Returns the value of the token property. | Returns the value of the token property. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getProperty(property); | token.getProperty(property); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 93: | Line 93: | ||
Sets the value of the token property. | Sets the value of the token property. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.setProperty(property, newValue); | token.setProperty(property, newValue); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 105: | Line 105: | ||
Returns the X position of the token. | Returns the X position of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getX(); | token.getX(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 118: | Line 118: | ||
Returns the Y position of the token. | Returns the Y position of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.getY(); | token.getY(); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 130: | Line 130: | ||
Sets the X position of the token. | Sets the X position of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.setX(newX); | token.setX(newX); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Line 142: | Line 142: | ||
Sets the Y position of the token. | Sets the Y position of the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="javascript" line> | ||
token.setY(newY); | token.setY(newY); | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
Revision as of 17:50, 14 March 2023
This article describes a feature or macro function that is experimental and may be subject to change.
Within the javascript environment used by js.eval
, Tokens are represented by the Token
class. The token class cannot be directly instantiated, but tokens can be found from the MapTool
top level name.
token.getNotes() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getNotes();
token.setNotes() Function
Note: This function can only be used in a Trusted Macro
Usage
token.setNotes(newNotes);
token.getName() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getName();
token.setName() Function
Note: This function can only be used in a Trusted Macro
Usage
token.setName(newName);
token.hasSight() Function
Note: This function can only be used in a Trusted Macro
Usage
token.hasSight();
token.getId() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getId();
token.getProperty() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getProperty(property);
token.setProperty() Function
Note: This function can only be used in a Trusted Macro
Usage
token.setProperty(property, newValue);
token.getX() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getX();
token.getY() Function
Note: This function can only be used in a Trusted Macro
Usage
token.getY();
token.setX() Function
Note: This function can only be used in a Trusted Macro
Usage
token.setX(newX);
token.setY() Function
Note: This function can only be used in a Trusted Macro
Usage
token.setY(newY);