[solved] Mouse Position relative to a window (in relative)

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

dragonblood
Just popping in
Just popping in
Posts: 17
Joined: Mon Dec 05, 2011 13:23

[solved] Mouse Position relative to a window (in relative)

Postby dragonblood » Sun Dec 25, 2011 13:55

Hi,

I want to get the mouse position relative to a window so I try this:

Code: Select all

CEGUI::Vector2 mCursorPosition=CEGUI::MouseCursor::getSingleton().getPosition();

CEGUI::Vector2  wndPt = CEGUI::CoordConverter::screenToWindow(*eDragDrop.window ,mCursorPosition );


Cursor coord are now Base upon my window but the problem is that the coord is Absolute. I want it relative

In this topic viewtopic.php?f=2&t=942, it said to use Window::relativeToAbsolute but this function seem not to exist in CEGUI 0.7.2..

So do you have an idea ?


sorry for my english
Last edited by dragonblood on Mon Dec 26, 2011 13:53, edited 1 time in total.

dragonblood
Just popping in
Just popping in
Posts: 17
Joined: Mon Dec 05, 2011 13:23

Re: Mouse Position relative to a window (in relative coord)

Postby dragonblood » Mon Dec 26, 2011 13:52

Ok I've found a solution :D

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

Re: Mouse Position relative to a window (in relative coord)

Postby Kulik » Mon Dec 26, 2011 13:57

You can always get absolute window position using Window::getIUnclippedOuterRect (http://www.cegui.org.uk/docs/current/cl ... 8d82df9a62). It should be fairly easy to use the power of math to solve your problem then :-)

btw: I frequent the Ogre forums as well and saw your thread and we are not entirely dead here, we are just slightly annoyed that people just come here to get their questions answered and never contribute anything back, they don't reply to any other threads and they don't improve wiki, etc...

EDIT: Hmm, you probably beat me to it.

dragonblood
Just popping in
Just popping in
Posts: 17
Joined: Mon Dec 05, 2011 13:23

Re: [solved] Mouse Position relative to a window (in relativ

Postby dragonblood » Mon Dec 26, 2011 17:41

OK but I don't know how I can contribute for this moment, I'm even new in CEGUI, I have to learn more before and I have difficulties to understand some post because I don't speak english at all.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests