i hope there will be some events notices me what the cursor exactly is(arrow,sizing,textinputing,busy,etc) when it changed,whatever i use or not use the cegui cursor.
i`m currently working on my level editor,and for some reason i`d better let user use system cursor,so i need to change the system cursor to 'textinput' when user sopt on a editbox,or change it to 'sizing' when user spot on a sizeable FrameWindow`s border.
is there a simple and directly solution?
thanks for any help.
[slvd]are there any way to monitor the cursor state changing
Moderators: CEGUI MVP, CEGUI Team
[slvd]are there any way to monitor the cursor state changing
Last edited by Cloudage on Tue Nov 17, 2009 10:05, edited 1 time in total.
- scriptkid
- Home away from home

- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: are there any way to monitor the cursor state changing?
Hi,
The mousecursor has an 'EventImageChanged' event, which is fired when the cursor changes. So you could intercept it to handle your own cursor appearance. You will receive a 'MouseCursorEventArgs' argument type containing the cursor and its current image (CEGUI::Image). This makes me think that it does not actually have a state. So you should interpret the different images yourself.
I don't have all code at hands, but your should probably listen to it with this code:
Note that in order for this to work, your Cegui windows need to be 'alive'. Meaning that you should pass mouse events (which you receive in your editor application) into Cegui aswell.
Also, the internal behaviour changes the cursor image, so you might end up with two cursors. I think that you can overwrite this by resetting the cursor image to Null from your event handler. But i am not sure about this behaviour.
Anyway, good luck
The mousecursor has an 'EventImageChanged' event, which is fired when the cursor changes. So you could intercept it to handle your own cursor appearance. You will receive a 'MouseCursorEventArgs' argument type containing the cursor and its current image (CEGUI::Image). This makes me think that it does not actually have a state. So you should interpret the different images yourself.
I don't have all code at hands, but your should probably listen to it with this code:
Code: Select all
MouseCursor::getSingleton().subscribeEvent(MouseCursor::EventImageChanged, Event::Subscriber(&YourApp::YourHandler, this));
Note that in order for this to work, your Cegui windows need to be 'alive'. Meaning that you should pass mouse events (which you receive in your editor application) into Cegui aswell.
Also, the internal behaviour changes the cursor image, so you might end up with two cursors. I think that you can overwrite this by resetting the cursor image to Null from your event handler. But i am not sure about this behaviour.
Anyway, good luck
Check out my released snake game using Cegui!
Re: are there any way to monitor the cursor state changing?
thank you scriptkid, i got it.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 15 guests
