Question about setMouseCursor

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Question about setMouseCursor

Postby cCj » Thu Dec 02, 2010 03:41

Hi i was using setMouseCursor to change cursor icon but wasnt able to change cursor to more than one image.

Code: Select all

// This works:
gameWin->setMouseCursor("cselect","test456");

// but not this:

if(something)
gameWin->setMouseCursor("cselect","test456");
else
gameWin->setMouseCursor("cselect","test123");




am i trying to use setMouseCursor properly?

thx!


Log part:

Code: Select all

02/12/2010 05:22:17 (Std)    ---- Version 0.7.4 (Build: Oct 11 2010 Microsoft Windows MSVC++ 10.0 32 bit) ----
02/12/2010 05:22:17 (Std)    ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based 2nd generation renderer module.  TextureTarget support enabled via FBO extension. ----
02/12/2010 05:22:17 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
02/12/2010 05:22:17 (Std)    ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
02/12/2010 05:22:17 (Std)    ---- Scripting module is: None ----

rockoz
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Sep 22, 2009 02:26

Re: Question about setMouseCursor

Postby rockoz » Thu Dec 02, 2010 07:45

If you want to change mouse cursor in "gameWin" depending on "something" I think your code should work.

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Fri Dec 03, 2010 01:48

Thx..
i noticed the mouse icon changes only when you move mouse over some window.
am i missing some update call after setMouseCursor?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Question about setMouseCursor

Postby Kulik » Fri Dec 03, 2010 07:58

If you want to change the global cursor, see CEGUI::System::setDefaultMouseCursor, Window::setMouseCursor sets the cursor that is only seen when mouse gets over that window.

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Fri Dec 03, 2010 19:00

Thx, i want to change the cursor only for the Root window and keep it default for all the actual windows.
Problem is setMouseCursor()
doesnt change it until you hover mouse over some window other than the root.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Question about setMouseCursor

Postby Jamarr » Fri Dec 03, 2010 20:30

This sounds odd. In any case, have you tried invalidating the window? calling draw() on the cursor (force geometry redraw)? or perhaps even using System::notifydisplaysizechanged() to force refreshing the entire gui? Obviously you should not have to do this, but one of these may work as a temporary solution until it can be fixed in the CEGUI source.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Question about setMouseCursor

Postby Kulik » Fri Dec 03, 2010 21:05

It's implemented to only react to mouse enters surface and mouse leaves surface events. It won't work for the child windows (their surface isn't parent's surface)! I suggest you use setDefaultCursor instead.

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Fri Dec 03, 2010 21:52

Jamarr wrote:This sounds odd. In any case, have you tried invalidating the window? calling draw() on the cursor (force geometry redraw)? or perhaps even using System::notifydisplaysizechanged() to force refreshing the entire gui?


Thx I tried those but it didnt work.

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Fri Dec 03, 2010 21:54

Kulik wrote:It's implemented to only react to mouse enters surface and mouse leaves surface events. It won't work for the child windows (their surface isn't parent's surface)! I suggest you use setDefaultCursor instead.


Thx i understand. put the problem is that if you change the cursor for the window the mouse is on, the cursor wont be updated until you move the cursor off from that window.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Question about setMouseCursor

Postby Jamarr » Fri Dec 03, 2010 21:57

Unfortunately I do not have time to debug the issue myself, and thus derive a fix. But you might also try injecting the current mouse position, or manually firing the MouseEntersSurface event to perhaps force the update.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Question about setMouseCursor

Postby Kulik » Fri Dec 03, 2010 22:34

The clean fix would be to alter setMouseCursor to check if mouse is over the surface and immediately switch the cursor if so.

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Fri Dec 03, 2010 23:46

Kulik wrote:The clean fix would be to alter setMouseCursor to check if mouse is over the surface and immediately switch the cursor if so.


Yep. Can someone post this to bug tracker?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Question about setMouseCursor

Postby Kulik » Fri Dec 03, 2010 23:57

cCj wrote:
Kulik wrote:The clean fix would be to alter setMouseCursor to check if mouse is over the surface and immediately switch the cursor if so.


Yep. Can someone post this to bug tracker?


Go ahead, you officially have my seal of aproval :)

cCj
Not too shy to talk
Not too shy to talk
Posts: 38
Joined: Fri Jul 23, 2010 04:36

Re: Question about setMouseCursor

Postby cCj » Sun Aug 07, 2011 21:08

Ok I did and CE responded back, that it, is solved in 0-7 tag. But when I download 0.7.5 it wasnt fixed there... So do I need to download 0.7 ??

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Question about setMouseCursor

Postby Kulik » Sun Aug 07, 2011 21:33

Yeah, I think it isn't released yet. You can grab the mercurial sources and switch to v0-7 branch


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests