SFML community forums
General => Feature requests => Topic started by: JayArby on November 17, 2011, 05:36:47 pm
-
It would be really nice if I could change the mouse icon the same way as the window icon. So far the only way I know to do it is to hide the mouse and draw the cursor myself each frame, which is a pain. Might such a feature be added in the future? (Or if it is already available, did I miss it somehow?)
-
which is a pain
Really? I think it's pretty easy to implement.
-
It's not difficult to implement, but it is nice to have the cursor overlaid by the OS so that it is rendered independently of my graphics. It's not absolutely essential, but it would certainly be nice. Why not provide it?
-
Well, it is easy enought to make by yourself and you can make extra effects this way, so what's the point?
-
Don't really think this is that unimportant or pointless. Using the hardware/system cursor can be an advantage, e.g. when you've got UI elements on your borders and you'd like the cursor to overlap the actual window or when you'd like the user being able to move the cursor while your main UI thread is busy or locked due to whatever reason. It could as well allow you easier access to the system cursors to provide the user with a consistent UI experience (esp. for non-game related programs).
-
You can draw your cursor on the top using Group as layers (https://github.com/SFML/SFML/wiki/TutorialDrawableGroup).
I'm more concerned about speed: on my computers, the Sprite cursor is actually following the OS cursor but they don't move in sync: the Sprite is slower. I don't know how OS handle cursors, but when I occasionnaly get lags, the only thing that moves as usual is the cursor.
There is another problem, surely related to the previous one: when you move the cursor quickly out of the window, the sprite cursor doesn't disappear of sight, it remains near the side of the window.
-
Why not provide it?
Why not use the search function just to find out that this question has been raised a numerous times... ;)
-
Unfortunatelly, search does give me subjets but no answers :(. Here (http://en.sfml-dev.org/forums/index.php?topic=6826.msg45069#msg45069), Mario said something interesting but got no response. There is also this weird problem (http://en.sfml-dev.org/forums/index.php?topic=394.msg2339#msg2339). I searched this (http://en.sfml-dev.org/forums/index.php?action=search2). Please, if you have the link to the answer, could you post it here?
-
Yeah, I still think this is a very important feature that should be included. But I guess Laurent doesn't think so.
-
It's not really quite that simple though, because then you get into the issue of whether or not cursors should be animated, and how you should handle multiple cursor images (for example, changing the image based on what the mouse is hovering over), etc. Each game seems to use the cursor differently, and I don't think there's a clean way to solve all these problems, and just implementing a naive solution is just a waste of time as users of SFML can easily implement it in just a few lines of code.
-
Cornstalks is right, but only when we want complex cursors.
-
Cornstalks is right, but onyl when we want complex cursors.
It's sooo simple to implement a simple cursor (a bit more complicated for a complex one, but nothing impossible).
It's just an image or a vertex array following the (invisible) real mouse.