Manual placement of mouse cursor

Can we have a way in which we can place the mouse cursor manually using the events system.

So that we are able to do something like restricting the player’s mouse cursor to go out of the scene or putting the mouse cursor at the middle of the scene when the scene begins, etc

I have seen that the mouse cursor spawns at (0,0) in the scene by default

1 Like

If you set up a custom mouse cursor (place an object on the position of the cursor), you should be able to restrict its movements, but GDevelop cannot control the real Windows/Mac cursor, as far as I know, because it’s built on HTML5.
Imagine if a website could disable/control your mouse. :scream:

The best solution would be using the JavaScript api for catching the mouse. Bascically, it will hide the mouse and instead of giving a position the mouse will give a delta (amount of movement). You can then apply that delta to a cursor sprite and use other invisible sprites as collisions or change the position of the sprite at any time to configure cursor movement however you want

I truly appreciate this and have imagined it.Thank You for the realization. @Gruk

Can you please Explain a bit more @arthuro555

I just wanted to know how can I place the mouse cursor at the middle of the scene just when the game begins or rather when the scene begins.:confused: