this is going to be kinda strange to explain so stay with me here.
I get no errors in my program, and im trying to build a game and at the moment im just working on the main menu but i was building it into a full program (i have state managers, etc.) So i built in the GUI and at first it worked.. i had a seg fault stopping the "restart" feature i was implementing.. so i closed the game for a bit.. came back a week later and when trying to load the game it didn't work AT ALL. where as a week ago it did.. so i went ahead and fixed the seg fault that i had there... now the GUI loads (4 buttons on the screen) but i can't click on them.. they don't do anything, or make an indented image when clicked on.. it's like they are just there...
now here is something alittle more sepecific to how the game itself is running behind the scenes to see what you all can make of it.
main.cpp:
Code: Select all
RPGDevice rpg;
IrrlichtDevice *device = 0;
EventHand *handle = new EventHand; // did this to fix a seg fault, it DOES inherit IEventReciever
.....
device = createDevice(...)
device->setEventReciever(handle);
handle->setDevice(device);
handle->setRPG(rpg);
eventhand.cpp
Code: Select all
class EventHand : IEventReciever
{
virtual bool OnEvent(SEvent event);
....
}rpgdevice.cpp
Code: Select all
//pseudocode for length of post
// this is all done in OO, and it all compiles properly
void swichscene(int num)
{
...
case 1:
menu.loadMain();
case 2:
menu.loadSingle();
...
}mainmenu.cpp
Code: Select all
#define HEIGHT(num) scaleHeight( num , res.Y)
// this is actually in mainmenu.h but oh well..
......
void MainMenu::loadMain()
{
// if this is the FIRST time that the menu will be loaded then
// draw the background scene.. basically makes the background scene or not
if(checkFlag(MENU_FIRST) == 1)
{
//device->getSceneManager()->loadScene("./menu/menu.irr");
// commented out since im not working with gfx at the moment
setFlag(MENU_FIRST, 0);
}
// height of the buttons
s32 H = HEIGHT(75);
// space between the buttons
s32 S = HEIGHT(25);
// Y values for all 8 Y coords
s32 y1 = HEIGHT(700);
s32 y2 = y1 - H;
s32 y3 = y2 - S;
s32 y4 = y3 - H;
s32 y5 = y4 - S;
s32 y6 = y5 - H;
s32 y7 = y6 - (S + H);
s32 y8 = y7 - H;
IGUIButton *button1 = gui->addButton(rect<s32>(res.X1, res.Y - y1, res.X2, res.Y - y2), 0, 1, L"Campaign");
IGUIButton *button2 = gui->addButton(rect<s32>(res.X1, res.Y - y3, res.X2, res.Y - y4), 0, 2, L"Multiplayer");
IGUIButton *button3 = gui->addButton(rect<s32>(res.X1, res.Y - y5, res.X2, res.Y - y6), 0, 3, L"Cinematic");
IGUIButton *button5 = gui->addButton(rect<s32>(res.X1, res.Y - y7, res.X2, res.Y - y8), 0, 5, L"Exit Game");
}Thanks in advance, Coolkat.
