I got a beginner problem. I write to cegui fonts layout etc /demo7/ and I implemented the Quit button event.
But it not do anything.
My code:
...
cegui->Initialize ();
cegui->GetLoggerPtr ()->setLoggingLevel(CEGUI::Informative);
cegui->GetSchemeManagerPtr ()->loadScheme("ice.scheme");
cegui->GetSystemPtr ()->setDefaultMouseCursor("ice", "MouseArrow");
cegui->GetFontManagerPtr ()->createFont("Vera", "/fonts/ttf/Vera.ttf", 10,
CEGUI::Default);
CEGUI::WindowManager* winMgr = cegui->GetWindowManagerPtr ();
cegui->GetSystemPtr ()->setGUISheet(winMgr->loadWindowLayout("ice.layout"));
....
void Demo7::initDemoEventWiring(void)
{
using namespace CEGUI;
WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&Demo7::HandleQuit, this));
}
bool Demo7::HandleQuit(const CEGUI::EventArgs& e)
{
-event-
return true;
}
CEGUI events
Moderators: CEGUI MVP, CEGUI Team
- SOMRoberto
- Just popping in
- Posts: 20
- Joined: Sat Dec 31, 2005 21:08
- Contact:
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: CEGUI events
It looks fine. what are you saying the problem is?
- SOMRoberto
- Just popping in
- Posts: 20
- Joined: Sat Dec 31, 2005 21:08
- Contact:
Re: CEGUI events
lindquist wrote:
It looks fine. what are you saying the problem is?
Hmm. This event not do anything. Is layout reading automatic muont the elements too?
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: CEGUI events
I'm sorry I don't understand your issue. What is it you're asking?
- SOMRoberto
- Just popping in
- Posts: 20
- Joined: Sat Dec 31, 2005 21:08
- Contact:
Re: CEGUI events
I see elements position in Layout file, but not declaration. My code is good?
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: CEGUI events
It's possible to define elements and their sizes etc. entirely from xml layouts, yes. You'll need to load the layout it self in code, but it's easy.
You could consider joining the #cegui IRC channel on irc.freenode.net - at least I am find it a little hard to understand exactly what you mean.
You could consider joining the #cegui IRC channel on irc.freenode.net - at least I am find it a little hard to understand exactly what you mean.
- SOMRoberto
- Just popping in
- Posts: 20
- Joined: Sat Dec 31, 2005 21:08
- Contact:
Re: CEGUI events
Just take the singleton and etc on mouse click event:
if (mouse->GetLastButton(0)) //left mouse button
{
using namespace CEGUI;
WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&TTViewer::HandleQuit, this));
}
U can using this code in Crystal Space engine.
if (mouse->GetLastButton(0)) //left mouse button
{
using namespace CEGUI;
WindowManager::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&TTViewer::HandleQuit, this));
}
U can using this code in Crystal Space engine.

Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 8 guests