Page 1 of 1
how can I stop the game and preload it later on
Posted: Wed Apr 11, 2007 5:02 pm
by raubritter
hi,
In nearly every game you come to the Options by using ESC. I had testet a lot. Now, if I push ESC the Option comes, but In the background the play runs and the coursor is in the middle of the window. What can I do, to rotate with the coursor how I want. And the play dont recognice it.
Posted: Wed Apr 11, 2007 5:09 pm
by Luben
Use the scenemanager to get a pointer to the active camera when pausing/unpausing, and call camera->setInputReceiverEnabled(true/false)
Posted: Wed Apr 11, 2007 6:15 pm
by raubritter
thanks, but I have a new problem:
I have addet scene::ICameraSceneNode* camera = 0; so that there are no more problems.
But, when I start the game and klick on ESC the error is:
Demo.exe hat ein Problem festgestellt und muss beendet werden.
Demo.exe had found a problem and must be end.
here I dont know, what to do
Posted: Wed Apr 11, 2007 6:49 pm
by Luben
You need to set the pointer too, using camera=scenemanager->getActiveCamera()
Posted: Wed Apr 11, 2007 8:15 pm
by raubritter
thx
now I have this code:
Code: Select all
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.Key == KEY_ESCAPE &&
event.KeyInput.PressedDown == false)
{
scene::ICameraSceneNode* camera = 0;
scene::ISceneManager* scenemanager = device->getSceneManager();
camera=scenemanager->getActiveCamera();
IGUIEnvironment* guienvironment = device->getGUIEnvironment();
IGUIWindow* wnd = guienvironment ->addWindow(rect<s32>(100,100,300,200),false,L"Optionen");
guienvironment -> addStaticText(L"Wollen sie das\n Spiel wirklich beenden?",rect<s32>(50,30,350,350),false,true,wnd);
BeendenButton = guienvironment->addButton(core::rect<int>(14, 15,100,50), false, 1, L"Beenden");
device->getCursorControl()->setVisible(true);
camera->setInputReceiverEnabled(true);
}
else
if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED )
{
device->closeDevice();
start = false;
}
but nothing happens.
In the demo I can go around with the coursor but nothing happens, when I click on the Button.
In the game there is no unpausing, like it should be
(srry my english is so terrible)
Posted: Wed Apr 11, 2007 9:04 pm
by Luben
What does your main loop look like? It might be that your are forgetting to draw the gui