0 votes

I'm currently trying to develop an isometric RPG(ish) game which should implement a mouse cursor which is following my mouse movement. Furthermore said cursor should stop at the edge of the "game window". So far this works fine. A small detail which bothers me is the fact that the cursor is stopping, but is still clipping out of my game window. I've now worked out two approaches to solve this problem:

A.) Hard-coded borders which incoporate the cursor size
B.) Use some solution which is provided by the Godot Engine itself
C.) Implement Cursor as a sprite

Now, considering option B.) is there any solution which may be a good fit? I've already looked for a hint inside the documentation. Unfortunatly I couldn't find anything.


Thank you for the advice. However, I'm already using the MouseMode you've mentioned. (In theory) the problem is non-existent because the top-left part of the cursor is stopping at the edge of the game window. The practical problem is that the rest of the cursor is hanging outside of the window

I want to use a confined mouse cursor which stays inside the window completly. Completely means that the cursor and its sprite are inside the game window all the time.
In the MouseMode MouseMode.MOUSEMODECONFINED the pointer of the cursor is stopping at the edge of the game window. However, the sprite "overflows" outside of the game window

Thanks in advance for any help

Godot version 3.2.3
in Engine by (12 points)
edited by

By clipping do you mean that part of the cursor is out of the window when cursor is on the right and bottom edges of the game window? Also are you using mouse mode confined or something else?

Can you include more information about the behavior you are aiming to get?
I'm not sure about what you need but you could try moving the mouse cursor based on the distance from the center.

Please log in or register to answer this question.

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.