onMouseOver: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
This event is triggered whenever the cursor moves over a token on the token layer. | This event is triggered whenever the cursor moves over a token on the token layer. | ||
Returns a string list that contains {{code|token ID}}, {{code|X}}, {{code|Y}}, {{code|Shift Key Down State}}, {{code|Control Key Down State}} | |||
== Set up == | == Set up == | ||
Line 15: | Line 17: | ||
The library token must have "Owner: All Players" unchecked, otherwise {{code|onMouseOver}} is not executed. To avoid permission issues with called functions, the {{code|onMouseOver}} macro should have "Options: Allow Players to Edit Macro" unchecked. | The library token must have "Owner: All Players" unchecked, otherwise {{code|onMouseOver}} is not executed. To avoid permission issues with called functions, the {{code|onMouseOver}} macro should have "Options: Allow Players to Edit Macro" unchecked. | ||
You can use {{code|macro.args}} to retrieve string list. | |||
You can use {{code|macro.args}} to retrieve | |||
[[Category:Special Macro]] | [[Category:Special Macro]] | ||
[[Category:Event]] | [[Category:Event]] | ||
[[Category:Macro Function]] | [[Category:Macro Function]] |
Revision as of 19:53, 12 February 2024
• Introduced in version 1.15.0
This event is triggered whenever the cursor moves over a token on the token layer.
Returns a string list that contains token ID
, X
, Y
, Shift Key Down State
, Control Key Down State
Set up
A special macro that can be created on library tokens to have macro code automatically execute when the cursor moves over OR off of a token on the token layer.
This special macro is ideally suited for setting parameters specific to the token you have moved over.
When an onMouseOver macro is executed automatically, it is considered a Trusted Macro. If you wish to use trusted functions within onMouseOver
and execute it manually (e.g. while developing macros), you will have to make sure that it follows all of the rules of Trusted Macros.
How to Create an onMouseOver Macro
You can create an onMouseOver
macro on any library token; simply create a macro that is specifically named onMouseOver
.
The library token must have "Owner: All Players" unchecked, otherwise onMouseOver
is not executed. To avoid permission issues with called functions, the onMouseOver
macro should have "Options: Allow Players to Edit Macro" unchecked.
You can use macro.args
to retrieve string list.