Mouse click coordinates

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

jaguillard
Just popping in
Just popping in
Posts: 12
Joined: Wed Jun 04, 2008 21:24

Mouse click coordinates

Postby jaguillard » Mon Jun 30, 2008 21:23

Once a mouse click has registered with a CEGUI window, is there anyway to grab the coordinates the window was clicked on? Whether it is screen coordinates or window based coordinates doesn't matter.

earthsruler
Quite a regular
Quite a regular
Posts: 74
Joined: Mon Apr 28, 2008 23:21
Location: Australia

Postby earthsruler » Mon Jun 30, 2008 23:16

Hi!

You can subscribe a "Clicked" callback for the window in question and in the callback cast the EventArgs parameter to a MouseEventArgs. This will let you get the mouse position in screen coordinates.

I don't think there is a way to get it at a later time, so if you need to know at a later date you can use the callback to get the position and store it untill you need it.

HTH.

ER.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 7 guests