Code: Select all
class MyEventReceiver : public IEventReceiver
{
int x,y,z;
public:
MyEventReceiver(SAppContext & context) : Context(context)
{
for (u32 i=0; i<KEY_KEY_CODES_COUNT; ++i)
KeyIsDown[i] = false;
}
// This is used to check whether a key is being held down
virtual bool IsKeyDown(EKEY_CODE keyCode) const
{
return KeyIsDown[keyCode];
}
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
KeyIsDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
}
if (event.EventType == EET_GUI_EVENT)
{
#does not print statement, not recieving any gui events
cout<<"gui_test";
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* env = Context.device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
switch(id)
case GUI_ID_Left_Arrow:
.....
Code: Select all
IGUIButton* Left_Arrow = env ->addButton(rect<s32>(10,10,387-90,630), 0,GUI_ID_Left_Arrow);
Left_Arrow->setImage(driver->getTexture("left_arrow/Comp 1_00000.png"));
Left_Arrow->setUseAlphaChannel(true);
Left_Arrow->setDrawBorder(false);