-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom cursors don't scale the same as ui elements, when monitors are scaled #97390
Comments
This is likely an OS issue as custom cursors are rendered by the operating system, but there might be some way to configure this but otherwise this is not something that Godot controls |
Unfortunately this seems to be very cumbersome to implement on windows (see godotengine/godot-proposals#9262 for discussion) as it seems to require setting up specific windows multi-resolution cursor resources to get resolution-based versions. But I agree that the lack of resolution-based custom cursors support is a problem. |
Its also worth noting that the default cursor on windows does get scaled when you change the monitor's scaling. |
What I would do to address this particular problem is to have Godot do an However, you currently can't get the display scale factor on Windows or Linux (X11) due to godotengine/godot-proposals#2661. |
Considering each cursor type will likely be static in most cases one alternative (previously discussed here) I'd favor is to add cursor setup as a new project settings tab, similar to Input mapping and autoloads. So for each project you could set up what custom images and settings you want to use for your cursors in the editor UI instead of in code. This would then both support adding multiple/high-resolution versions of the cursor images (typically only a 1x and a 2x version) and adding additional custom cursors in addition to the standard set. This would make it easier to set up cursors and have the benefit of the data being available at build time, so the engine could generate the needed resources or versions of the graphics at build time as required by windows, and do all the setup of any custom cursors so you don't need to do it in code. And then we could let the OS scale/pick which cursor resolution to use instead of trying to figure out when/how to scale it ourselves. |
Tested versions
System information
Godot v4.3.stable (77dcf97) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 6650 XT (Advanced Micro Devices, Inc.; 32.0.11021.1011) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)
Issue description
When using monitors with different scaling, custom mouse cursor images aren't scaled.
UI elements work fine and will correctly update when changing a monitor's scaling percent.
Steps to reproduce
Input.set_custom_mouse_cursor(CUSTOM_CURSOR)
3b. You can also change the scale of the monitor the game window is currently on.
Minimal reproduction project (MRP)
Custom Cursor Scaling.zip
Cursor size should match the color rect.
Expected (100% scale):
Actual (150% scale):
The text was updated successfully, but these errors were encountered: