Replace Mouse Cursor with Sprite?

I can’t find any relevant information on how to replace the mouse cursor with a sprite.
I’m having a hard time believing that this engine can’t replace the cursor with a designated sprite, easily. I’m leaning more towards me not having good search skillz. Thoughts? Is this functionality non-existent?
Every other engine I’ve toyed with can replace the cursor in a few clicks.

2 Likes

Which platform are you working on? It is possible to do this right now with native extensions. We have some progress done with DefOS but it still needs more work and time is pretty limited for some of us.

The reason why this engine doesn’t have that kind of feature built in yet is because it was made for mobile first.

Steps are to hide the hardware cursor and then set the sprite to the xy of the cursor xy. Print your actions and you can see which value to use for cursor xy when positioning your sprite.

It should be possible to support hardware cursors too.

2 Likes

Like @Pkeod says, there’s no built-in way to disable the mouse cursor and replace it, but it’s easy to do on your own. I created an example using DefOS and a game object with a sprite that follows the mouse position: https://github.com/britzl/publicexamples/blob/master/examples/replace_mouse_cursor/replace_mouse_cursor/replace_mouse_cursor.script

Is there a motion lag?

There shouldn’t be any motion lag since input is processed before update, but I didn’t really give it much thought when I created the example.

1 Like

Thank you all very much for taking your time to help. I appreciate the information and will delve into the examples provided.

Hardware OS cursors will not lag in the same software cursors rendered in game may sometimes lag. Game chugging or something loading which is making the rendering lag. That’s why hardware OS cursors are better for user quality of experience for desktop games and what most AAA desktop games use for their cursors especially first person shooters.

3 Likes

How are things regarding this toady?

Pretty ok. DefOS supports custom hardware cursors on all desktop platforms.

3 Likes