Hi Guys, I'm having trouble getting event handling to work. I also set up event hanlders for mouseEnter and MouseLeave but none get called? All these things display fine.
[code]CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
wmgr.getWindow("Spellbar")->subscribeEvent(
CEGUI::Window::EventMouseClick,
CEGUI::Event::Subscriber(&Spellbar::handleMouseClick, this));
from my .layout file:
<GUILayout>
<Window Type="DefaultGUISheet" Name="root">
<Window Type="DefaultGUISheet" Name="Spellbar">
<Property Name="Position" Value="x:0 y:.85" />
<Property Name="Size" Value="w:1 h:.2" />
<Window Type="TaharezLook/StaticImage" Name="Spellbar/background">
<Property Name="MetricsMode" Value="Absolute" />
<Property Name="Position" Value="x:0 y:0" />
<Property Name="Size" Value="w:600 h:68" />
<Property Name="Image" Value="set:MainScreen image:Spellbar" />
<Property Name="FrameEnabled" Value="false" />
</Window>
</Window>
</Window>
</GUILayout>[/code]
Any ideas whatelse I need to do?
need help Handling CEGUI events
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: need help Handling CEGUI events
try changing this line:
to this:
That's how I do it...
If this does not work, I'll look more into the event system. This is'nt the first time trouble like this is posted...
Code: Select all
CEGUI::Event::Subscriber(&Spellbar::handleMouseClick, this));
to this:
Code: Select all
CEGUI::Event::Subscriber(Spellbar::handleMouseClick, this));
That's how I do it...
If this does not work, I'll look more into the event system. This is'nt the first time trouble like this is posted...
Re: need help Handling CEGUI events
No it still doesn't get any events.
I looked at trying the latest CEGUI in cvs since it seems like a lot has changed but I don't see an Ogre renderer there? Is there an easy way to get the currrent cvs version to work with ogre?
I looked at trying the latest CEGUI in cvs since it seems like a lot has changed but I don't see an Ogre renderer there? Is there an easy way to get the currrent cvs version to work with ogre?
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: need help Handling CEGUI events
The Ogre renderer has been moved outside of CEGUI and into Ogre itself instead.
Re: need help Handling CEGUI events
Thanks I got it working. Stupid mistake on my part.
Re: need help Handling CEGUI events
jed,
If you happen to still be reading this forum, could you please post what your solution was? I am now having the same problem and came across this post. I just found ceGUI and am trying to implement it into a game that I have been working on. My layout and everything loads, I get the event registered with no errors now, but my handler never gets called. I am currently only trying to implement a handler for MouseEnter.
Thanks for the help.
During GUI setup:
And the handler:
I have set a breakpoint in the handler, but it never gets called. Also, I am injecting inputs properly as the cursor moves and the buttons highlight when moved over.
If you happen to still be reading this forum, could you please post what your solution was? I am now having the same problem and came across this post. I just found ceGUI and am trying to implement it into a game that I have been working on. My layout and everything loads, I get the event registered with no errors now, but my handler never gets called. I am currently only trying to implement a handler for MouseEnter.
Thanks for the help.
During GUI setup:
Code: Select all
wmgr.getWindow("btnSingle")->subscribeEvent(CEGUI::ButtonBase::EventNamespace+"/"+CEGUI::ButtonBase::EventMouseEnters,CEGUI::Event::Subscriber(EventMouseOver));
And the handler:
Code: Select all
bool EventMouseOver(const CEGUI::EventArgs& e)
{
SoundManager->PlaySound(g_iGameSounds[MENU_DRAGOVER]);
return true;
};
I have set a breakpoint in the handler, but it never gets called. Also, I am injecting inputs properly as the cursor moves and the buttons highlight when moved over.
Re: need help Handling CEGUI events
Okay, found my problem. I was making the event subscription way too complicated. I changed:
to
It works fine now!
BTW, CrazyEddie, great piece of software! Once I get this all figured out, I would be interested in helping you write tutorials to make the learning curve less steep.
Code: Select all
wmgr.getWindow("btnSingle")->subscribeEvent(CEGUI::ButtonBase::EventNamespace+"/"+CEGUI::ButtonBase::EventMouseEnters,CEGUI::Event::Subscriber(EventMouseOver));
to
Code: Select all
wmgr.getWindow("btnSingle")->subscribeEvent("MouseEnter",EventMouseOver);
It works fine now!
BTW, CrazyEddie, great piece of software! Once I get this all figured out, I would be interested in helping you write tutorials to make the learning curve less steep.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: need help Handling CEGUI events
Viper wrote:
BTW, CrazyEddie, great piece of software! Once I get this all figured out, I would be interested in helping you write tutorials to make the learning curve less steep.
Thanks
Any and tutorials should now be done via the wiki - and we're most grateful for all efforts in this area.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 12 guests