onMouseOver: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page OnMouseOver to onMouseOver: Converting page titles to lowercase)
(Removed redirect to onMouseOverEvent)
Tag: Removed redirect
Line 1: Line 1:
#REDIRECT [[onMouseOverEvent]]
==onMouseOver Macro==
'''• Introduced in version 1.15.0'''
 
A special macro that can be created on [[Library_Token|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 {{code|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 Macro]]s.
 
===How to Create an onMouseOver Macro===
You can create an {{code|onMouseOver}} macro on any [[Library_Token|library token]]; simply create a macro that is specifically named {{code|onMouseOver}}.
 
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.
 
===Variables provided to onMouseOver Macro===
You can use {{code|macro.args}} to retrieve the following information from this event:
 
{{code|token ID}} token ID
 
{{code|x}} {{code|y}} coordinates in pixels of the token
 
{{code|shift key state}} the state of the shift key
 
{{code|ctrl key state}} the state of the control key
 
 
[[Category:Special Macro]]
[[Category:Event]]
[[Category:Macro Function]]

Revision as of 15:34, 12 February 2024

onMouseOver Macro

• Introduced in version 1.15.0

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.

Variables provided to onMouseOver Macro

You can use macro.args to retrieve the following information from this event:

token ID token ID

x y coordinates in pixels of the token

shift key state the state of the shift key

ctrl key state the state of the control key