Page 1 of 1

mouse cursonr won't display

Posted: Tue Aug 30, 2005 11:11
by CannibalSmith
As I understand this should be sufficient to get the cursor rendering:

Code: Select all

CEGUI::System::getSingleton.setDefaultMouseCursor("TaharezLook", "MouseArrow");

But for me it won't diplay even after:

Code: Select all

CEGUI::MouseCursor::getSingleton().show();

Re: mouse cursonr won't display

Posted: Tue Aug 30, 2005 15:20
by Blakharaz
Do you inject mouse movement into CEGUI? IMHO the pointer isn't rendered if you never move the mouse.

Re: mouse cursonr won't display

Posted: Tue Aug 30, 2005 16:27
by CannibalSmith
It helps:

Code: Select all

void MyOwnFrameListener::mouseMoved(Ogre::MouseEvent *e)
{
    CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * 100, e->getRelY() * 100);
}


But sensitivity is very small. Even with when I multiply movement by 100 the pointer is very slow... it's okay? Or is there some very cool way to do this?

Re: mouse cursonr won't display

Posted: Thu Sep 01, 2005 02:57
by Viper
In my game, I track the absolute position of the mouse cursor and inject that and it works fine. You may want to try:

Code: Select all

void MyOwnFrameListener::mouseMoved(Ogre::MouseEvent *e)
{
    CEGUI::System::getSingleton().injectMousePosition(XPos,YPos);
}

I am not very familiar with Ogre, so I do not know if it has a built in method for getting the absolute position of the mouse or if you have to track it. I use DirectX and track the absolute position on my own by adding the relative to the absolute each time I read it, then inject it into ceGUI.

Re: mouse cursonr won't display

Posted: Thu Sep 01, 2005 08:30
by Blakharaz
I fear, factor 100 is too small. CEGUI wants to have pixel coordinates for the movements.
You'll have to use something like

Code: Select all

CEGUI::Renderer* renderer  = System::getSingleton().getRenderer();

System::getSingleton().injectMouseMove(
   e->getRelX() * renderer->getWidth(),
   e->getRelY() * renderer->getHeight());