how can I stop the game and preload it later on

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
raubritter
Posts: 12
Joined: Wed Mar 28, 2007 11:53 am

how can I stop the game and preload it later on

Post 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.
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

Use the scenemanager to get a pointer to the active camera when pausing/unpausing, and call camera->setInputReceiverEnabled(true/false)
If you don't have anything nice to say, don't say anything at all.
raubritter
Posts: 12
Joined: Wed Mar 28, 2007 11:53 am

Post 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 :(
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

You need to set the pointer too, using camera=scenemanager->getActiveCamera()
If you don't have anything nice to say, don't say anything at all.
raubritter
Posts: 12
Joined: Wed Mar 28, 2007 11:53 am

Post 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)
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

What does your main loop look like? It might be that your are forgetting to draw the gui

Code: Select all

guienvironment->drawAll();
If you don't have anything nice to say, don't say anything at all.
Post Reply