Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Cursor icon  (Read 6965 times)

0 Members and 1 Guest are viewing this topic.

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Cursor icon
« 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?)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Cursor icon
« Reply #1 on: November 17, 2011, 06:19:31 pm »
Quote
which is a pain

Really? I think it's pretty easy to implement.
Laurent Gomila - SFML developer

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Cursor icon
« Reply #2 on: November 17, 2011, 07:00:08 pm »
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?

Neomex

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Cursor icon
« Reply #3 on: December 28, 2011, 11:33:26 pm »
Well, it is easy enought to make by yourself and you can make extra effects this way, so what's the point?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Cursor icon
« Reply #4 on: December 30, 2011, 11:25:01 am »
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).

L01man

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Cursor icon
« Reply #5 on: May 01, 2012, 02:53:59 pm »
You can draw your cursor on the top using Group as layers.
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.
http://metroidprime4.xooit.fr/

Un même visage, un même passé, deux destins différents ?
Metroid Prime : Némésis, fangame de la suite du célèbre Metroid Prime 3 : Corruption.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Cursor icon
« Reply #6 on: May 01, 2012, 02:57:32 pm »
Why not provide it?

Why not use the search function just to find out that this question has been raised a numerous times... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

L01man

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Cursor icon
« Reply #7 on: May 01, 2012, 09:10:12 pm »
Unfortunatelly, search does give me subjets but no answers :(. Here, Mario said something interesting but got no response. There is also this weird problem. I searched this. Please, if you have the link to the answer, could you post it here?
http://metroidprime4.xooit.fr/

Un même visage, un même passé, deux destins différents ?
Metroid Prime : Némésis, fangame de la suite du célèbre Metroid Prime 3 : Corruption.

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: Cursor icon
« Reply #8 on: May 01, 2012, 11:22:46 pm »
Yeah, I still think this is a very important feature that should be included. But I guess Laurent doesn't think so.

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Re: Cursor icon
« Reply #9 on: May 02, 2012, 04:33:18 am »
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.

L01man

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Cursor icon
« Reply #10 on: May 02, 2012, 12:12:31 pm »
Cornstalks is right, but only when we want complex cursors.
« Last Edit: May 12, 2012, 01:08:24 am by L01man »
http://metroidprime4.xooit.fr/

Un même visage, un même passé, deux destins différents ?
Metroid Prime : Némésis, fangame de la suite du célèbre Metroid Prime 3 : Corruption.

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Cursor icon
« Reply #11 on: May 02, 2012, 03:24:25 pm »
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.