Customizing mouse cursor¶
You might want to change the appearance of the mouse cursor in your game in order to suit the overall design. There are two ways to customize the mouse cursor:
- Using project settings
- Using a script
Using project settings is a simpler (but more limited) way to customize the mouse cursor. The second way is more customizable, but involves scripting.
Using project settings¶
Open project settings, go to Display>Mouse Cursor. You will see Custom Image and Custom Image Hotspot.
Custom Image is the desired image that you would like to set as the mouse cursor. Custom Hotspot is the point in the image that you would like to use as the cursor's detection point.
The custom image must be less than 256x256.
Using a script¶
Create a Node and attach the following script.
Find out more by studying this demo project: https://github.com/guilhermefelipecgs/custom_hardware_cursor
As documented in the Input class (see the CursorShape enum), there are multiple mouse cursors you can define. Which ones you want to use depends on your use case.