0 votes

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?

in Engine by (12 points)

1 Answer

+2 votes

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.
else:
    # Load small hardware cursor here.

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

by (10,964 points)
edited by

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!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.