09-02-2020, 08:03 AM
In Experiment Builder, you can replace the standard mouse cursor with any screen resource (like an image) by making it mouse contingent. This locks the resource to the mouse's position, causing it to move and act like a custom cursor.
How to Enable a Custom Cursor
Using Transparent Cursor Images
We provide two ready-to-use, transparent cursor images (one black, one white) in the following folder:
Because these are PNG files with transparency, you must uncheck the Use Color Key property for the image resource. This will ensure the cursor has a transparent background instead of a black box.
Positioning the Cursor's "Hotspot"
By default, the active point (or "hotspot") of your custom cursor will be its center. To make the tip of the cursor the active point, you must use the Offset property.
Resetting the Cursor Position
To reset the mouse position at the start of each trial (e.g., to the center of the screen), use an Update Attribute node to set the mouse_position property.
Detecting Clicks
Creating a custom cursor does not automatically handle clicks. To record participant responses, you still need to use a Mouse Trigger. A Mouse Trigger can detect button presses and releases, either anywhere on the screen or within a specific, defined region.
For more details, see the article: "How can I make it so that the participant can click on certain parts of the screen?"
How to Enable a Custom Cursor
- Select any screen resource (e.g., an Image Resource) in your project.
- In its properties, check the box for Mouse Contingent.
Using Transparent Cursor Images
We provide two ready-to-use, transparent cursor images (one black, one white) in the following folder:
Quote:Documents\Experiment Builder\Examples\Resources\Images
Because these are PNG files with transparency, you must uncheck the Use Color Key property for the image resource. This will ensure the cursor has a transparent background instead of a black box.
Positioning the Cursor's "Hotspot"
By default, the active point (or "hotspot") of your custom cursor will be its center. To make the tip of the cursor the active point, you must use the Offset property.
- To align the hotspot with the cursor's tip, you generally need to offset the image by half of its width and half of its height. For example, if your cursor image is 30 pixels wide and 30 pixels high, and its tip is at the top-left corner, you would set:
- X Offset: -15
- Y Offset: -15
- X Offset: -15
Resetting the Cursor Position
To reset the mouse position at the start of each trial (e.g., to the center of the screen), use an Update Attribute node to set the mouse_position property.
- Example: To center the cursor on a 1024x768 screen, set the value to (512, 384).
Detecting Clicks
Creating a custom cursor does not automatically handle clicks. To record participant responses, you still need to use a Mouse Trigger. A Mouse Trigger can detect button presses and releases, either anywhere on the screen or within a specific, defined region.
For more details, see the article: "How can I make it so that the participant can click on certain parts of the screen?"