Page 1 of 1

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

Posted: Sun Dec 25, 2011 13:55
by dragonblood
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

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

Posted: Mon Dec 26, 2011 13:52
by dragonblood
Ok I've found a solution :D

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

Posted: Mon Dec 26, 2011 13:57
by Kulik
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.

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

Posted: Mon Dec 26, 2011 17:41
by dragonblood
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.