Hi,
Glad you have something working now.
There is an ImageButton for TaharezLook. The initial I is capitalised though, so "TaharezLook/ImageButton" is what you maybe needed.
Since you have it working with the standard button, obviously you're free to carry on with that
CE.
Image Buttons
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Image Buttons
I didn't want to open a new thread as this one is relevent, my problem is that i want to use the button that we created in the tutorial however i can't seem to get the subscribe event syntax correct.
there doesn't seem to be a CEGUI::ImageButton::EventClicked or something similar, any ideas (its probably really basic, just kinda starting out with cegui
Code: Select all
pChatContentBox = (CEGUI::MultiLineEditbox*)m_pChatWnd->getChild("ChatContentBox");
CEGUI::PushButton* pExitButton = (CEGUI::PushButton*)m_pMainWnd->getChild("ExitButton_Game");
pExitButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::onExitButtonGame, this));
pQuestPanel = (CEGUI::MultiLineEditbox*)m_pQuestWnd->getChild("QuestPanel");
m_pQuestWnd->subscribeEvent(CEGUI::FrameWindow::EventCloseClicked, CEGUI::Event::Subscriber(&GameState::onQuestExitButton, this));
CEGUI::Window *w = CEGUI::WindowManager::getSingleton().loadWindowLayout( "fireballBtn.layout" );
m_pMainWnd->addChildWindow( w );
w->setPosition( CEGUI::UVector2( CEGUI::UDim(0.0f,-32.0f), CEGUI::UDim(1.0f,-10.0f) ) );
w->setVisible( true );
-------------w->subscribtEvent(CEGUI::PushButton???--------------
there doesn't seem to be a CEGUI::ImageButton::EventClicked or something similar, any ideas (its probably really basic, just kinda starting out with cegui
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Image Buttons
Hi,
The main way to go here is to get an understanding of how we produce some of these various types within CEGUI. For example, looking in the scheme file for TaharezLook, we have the following lines:
The key information in these lines is the TargetType attribute - in this case CEGUI/PushButton. Now, this is the concrete Window based class that is being used, and this is what provides the event functionality. So, to conclude... In this case you still use CEGUI::PushButton, since this is the core type that the specific types are being bound to. Or to put it another way, "TaharezLook/Button" and "TaharezLook/ImageButton" are just skins over the same old PushButton type.
HTH
CE.
The main way to go here is to get an understanding of how we produce some of these various types within CEGUI. For example, looking in the scheme file for TaharezLook, we have the following lines:
Code: Select all
<FalagardMapping WindowType="TaharezLook/Button" TargetType="CEGUI/PushButton" Renderer="Falagard/Button" LookNFeel="TaharezLook/Button" />
...
<FalagardMapping WindowType="TaharezLook/ImageButton" TargetType="CEGUI/PushButton" Renderer="Falagard/Button" LookNFeel="TaharezLook/ImageButton" />
The key information in these lines is the TargetType attribute - in this case CEGUI/PushButton. Now, this is the concrete Window based class that is being used, and this is what provides the event functionality. So, to conclude... In this case you still use CEGUI::PushButton, since this is the core type that the specific types are being bound to. Or to put it another way, "TaharezLook/Button" and "TaharezLook/ImageButton" are just skins over the same old PushButton type.
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Image Buttons
Ty sir that made sense, however i believe i tryed that and got the following error:
So i tryed to clear things up a little but got the same error :S :
Code: Select all
error C2661: 'CEGUI::SubscriberSlot::SubscriberSlot' : no overloaded function takes 2 arguments
So i tryed to clear things up a little but got the same error :S :
Code: Select all
m_pw = CEGUI::WindowManager::getSingleton().loadWindowLayout( "fireballBtn.layout" );
m_pMainWnd->addChildWindow( m_pw );
CEGUI::PushButton* pFireball = (CEGUI::PushButton*)m_pMainWnd->getChild("fireballBtn");
m_pw->setPosition( CEGUI::UVector2( CEGUI::UDim(0.5f,-32.0f), CEGUI::UDim(1.0f,-10.0f) ) );
m_pw->setVisible( true );
pFireball->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&GameState::fireBall, this));
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Image Buttons
Ummm, ok.
What is the full function signature for GameState::fireball - it has to match 'bool function(const CEGUI::EventArgs&)' - and is the 'this' in the subscribe line an instance of GameState?
CE.
What is the full function signature for GameState::fireball - it has to match 'bool function(const CEGUI::EventArgs&)' - and is the 'this' in the subscribe line an instance of GameState?
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Image Buttons
Ty for your patience. This is what i needed to understand. Works beautifully
Who is online
Users browsing this forum: No registered users and 30 guests