From 1bd35135076ded7eecfe3898ac3a9dc3c7961fca Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 21 Apr 2023 01:17:26 +0200 Subject: [PATCH] =?UTF-8?q?Mention=20maximum=20recommended=20size=20of=201?= =?UTF-8?q?28=C3=97128=20in=20Customizing=20the=20mouse=20cursor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sizes larger than 128×128 are not supported in web exports and can exhibit rendering issues on desktop platforms. --- tutorials/inputs/custom_mouse_cursor.rst | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tutorials/inputs/custom_mouse_cursor.rst b/tutorials/inputs/custom_mouse_cursor.rst index 0de3e88c9..b056cf808 100644 --- a/tutorials/inputs/custom_mouse_cursor.rst +++ b/tutorials/inputs/custom_mouse_cursor.rst @@ -3,7 +3,9 @@ Customizing the 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: +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: 1. Using project settings 2. Using a script @@ -14,8 +16,8 @@ The second way is more customizable, but involves scripting: .. note:: You could display a "software" mouse cursor by hiding the mouse cursor and - moving a Sprite2D to the cursor position in a ``_process`` method, but this - will add at least one frame of latency compared to an "hardware" mouse + moving a Sprite2D to the cursor position in a ``_process()`` method, but + this will add at least one frame of latency compared to an "hardware" mouse cursor. Therefore, it's recommended to use the approach described here whenever possible. @@ -32,7 +34,12 @@ Open project settings, go to Display>Mouse Cursor. You will see Custom Image and 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. -.. note:: The custom image **must** be less than 256x256. +.. warning:: + + The custom image **must** be 256×256 pixels at most. To avoid rendering + issues, sizes lower than or equal to 128×128 are recommended. + + On the web platform, the maximum allowed cursor image size is 128×128. Using a script -------------- @@ -74,9 +81,10 @@ Create a Node and attach the following script. Input.SetCustomMouseCursor(beam, Input.CursorShape.Ibeam); } -.. note:: - Check :ref:`Input.set_custom_mouse_cursor() `. +.. seealso:: + Check :ref:`Input.set_custom_mouse_cursor() `'s + documentation for more information on usage and platform-specific caveats. Demo project ------------ @@ -87,4 +95,6 @@ https://github.com/guilhermefelipecgs/custom_hardware_cursor Cursor list ----------- -As documented in the :ref:`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. +As documented in the :ref:`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.