Hiding the mouse cursor (DEF-1619)

Iā€™m almost inclined to say that this issue should be closed. Yes, nice to have it in the engine, but if itā€™s readily available in an extension then itā€™s unlikely that weā€™ll give an engine integrated solution priority.

Iā€™ll try to make example project and upload to github.

1 Like

Iā€™m still of the opinion that all features of DefOS has should be core Defold eventually.

2 Likes

simple example
Custom Cursor Example.zip (2.2 MB)

I disagree with you.
As I told earlier modules with special functionality this is good architecture in my opinion. Better than huge engine with million api methods, and games which use only 1% of them.

I hope in future all exernal dependencies and appmanifest modules would be connect to the project by checkboxes (config with all modules can be generated and downloaded from the community page, for example).

3 Likes

Modularity is good and the appmanifest features are very good. I still think these features belong in core Defold and maintained by Defold team because they are universally important for shipping commercial games, maybe as an OS module which still be enabled or disabled with an appmanifest option.

2 Likes

I agree with both of you. :slight_smile:

Itā€™s great that DefOS is a module that you only add in if you need it. Plus, mobile and web projects especially need to keep the size down.

But . . .

To be honest I donā€™t like ^ this ^ very much (no offense, Britzl). The things that DefOS does (and more) are pretty much essential for any desktop project. The current built-in desktop support is so limited, I really donā€™t think itā€™s possible to make a desktop game without an extensionā€”at least not a polished and professional one.

This could be a long discussion, but anyway, I still hope for full, official support for desktop. Defold would be ideal for desktop games, if only it had these features! People wonā€™t choose an engine unless it already provides the things they need. (like this guy)

6 Likes

after years of this topic, what is the easy way to hide mouse cursor now?!

I have downloaded this example, i still see mouse cursor in game(windows 10)
edit:
i have one error:
ERROR:GAMESYS: Error running Window callback: /main/cursor.script:5: attempt to call field ā€˜enable_mouse_cursorā€™ (a nil value)

You should add DefOS.
Also its api has changed.

defos.set_cursor_visible(bool_value)
4 Likes

Thanks selimanac, does it workson html5 too?

I donā€™t know, I didnā€™t try it with DefOS.
You can simple hide cursor by using css+js on html page for canvas without defos. But hiding cursor on html canvas pretty weird to me.

1 Like

Iā€™m enjoying developing in Defold and I understand that it leans more towards a framework than a game engine but even love2d framework has a built-in,

love.mouse.setVisible(false)

This is such a basic requirement, using plugin for it feels like an overkill!

1 Like

Funny that you just replied to thisā€¦I read this post yesterday and was disappointed to find out I have to use an add-on. Plus when itā€™s a built-in the documentation can be consistent and easily found.

Maybe if they had approved add-ons that they referenced in their documentation and even put them in the engine for ease of adding them it would be better. And it would clue people in on where to get this functionality.

1 Like

Yes, we have the intention to add things like this but it is dependant on finishing the GLFW3 update for linux, which is already in flight. I hope we can get the new functions in before christmas.

2 Likes

Most of the time, every developer believes that a particular feature they need for their game should be part of the engine. However, if the engine were to include every feature that each individual developer considers a ā€œmust-have,ā€ it would become bloated, with a large size and 90% of features unused by most individual games.

You may argue, ā€œNo, not all of them, only this oneā€”itā€™s so obvious.ā€ To that, I would respond: Iā€™ve heard this argument countless times about thousands of different features. Thatā€™s why extensions exist.

4 Likes

I am totally onboard with keeping the engine minimalist, avoiding bloat and using plugins.

However thereā€™s a risk of minimalism descending into austerity and that might give a perception that using Defold has too many friction points compared to other similar frameworks like love2d.

As users who love Defold it is our responsibility to point out friction points and gaps, then leave it to the wisdom of the Defold team to fill those gaps.

Recent reply by @jhonny.goransson gives hope to those who would like this feature built-in.

Iā€™m not opposed to this particular feature, and itā€™s likely that it will be implemented in the engine. Iā€™m simply trying to explain the reasoning behind it.
The frictions you mentioned are the cost of other benefits, such as speed, small size, fewer breaking changes, etc.

Not exactly sure what the difference is here, but yes we are pretty strict with this approach. If thereā€™re is enough users/benefit to be included in the default functionality, we do it.
If it can be done by the user in Lua or via an extension, then we do that.
So itā€™s not a whole process, but fairly strict guidelines.

Right now though when I try to use DEFOS it gives me this error. I have to delete that folder and then run it everytime.

image

And this is using the sample project as Iā€™m trying to learn this. I get that error as well in my project. To me this add-in is a lot different then all the others and bit more complicated to get working.

Hereā€™s a video of it.
https://youtu.be/0QDH0edOr2Y