Is there no implemented scalability for custom Mouse Cursor's in Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CrazeeCreator

After so much researching on so many sites and with a dozen different attempts, I both found out and learned that I should only ever be using hardware cursors for custom in game cursors to make the mouse cursor flow and respond typically.

For customization’s of this demanded function, my research has found we can alter the interactive portion (the hotspot) of the cursor/cursor image, and I believe where the cursor (or is that Image) starts (the Vector).

Maybe this is an over the top stupid question, but can we not alter the size of custom cursors and their images?

I use a 150pixel by 145pixel cursor image.
However when I do my tests, I have tried various screen resolutions and the image doesn’t scale properly with the resolutions. in 800x600 is ginormous, in 1920x1080 it’s still larger than I want it to be. However, I am planning on making my game for PC, Tablets, and Phones, which have huge varying resolutions in comparison.

I am new to game programming and have researched many engines before deciding on this one due to its high customize ability and easier entry point, but I am still struggling here. It would be great to have options to both set a constant specific digit dimension as well as a % dimension based off of the viewport, so it stays the same relatively in any resolutions/on any system.

So basically, am I missing something?
Or is Godot still missing a feature that it could really benefit from?

:bust_in_silhouette: Reply From: Calinou

You could query the window height using OS.window_size.y and load a cursor of different sizes depending on the window height:

if OS.window_size.y > 1500:
    # Load large hardware cursor here.
elif OS.window_size.y > 1000:
    # Load medium hardware cursor here.
    # Load small hardware cursor here.

You will have to provide cursors of different sizes yourself by resizing them in an image editor.

Thanks Callnou!

I was thinking of a round-about and this too was the only way that I could come up with a solution. I was already working on the second portion of the solution you posted; to try and test implement it with the first portion you gave once I discovered it.

Thank you truly for the code as well. It saves me having to do even more work on this the simplest part of my program and dig up all the functions myself!

CrazeeCreator | 2020-12-12 08:48