Esempio n. 1
0
	InitializePhysX();
}

void Game::InitializeKinect()
{
	InputManager* inputManager = InputManager::GetInstance();
	
	inputManager->InitializeKinect(mWindow->getWidth(),mWindow->getHeight());
	
	//inputManager->FillGestureReader(L"C:\\Users\\Adam\\Desktop\\Test.gbd");
Esempio n. 2
0
void MenusScene::Initialize()
{
	InitializeResources(resourceGroupName);

	player1Nav = MenuNavigator(this);
	player1Nav.AllowMenuControls = true;

	player2Nav = MenuNavigator(this);

	Player1Data.MainElement = ElementEnum::Earth;
	Player2Data.MainElement = ElementEnum::Earth;

	InputNotifier::GetInstance()->AddObserver(&player1Nav);
	InputNotifier::GetInstance()->AddObserver(&player2Nav);

	guiManager->AddScheme("MainMenu.scheme");
	guiManager->LoadLayout("MainMenuLayout.layout", nullptr);
	guiManager->LoadLayout("GameSetupMenu.layout", nullptr);
	guiManager->LoadLayout("TutorialLayout.layout", nullptr);

	//guiManager->LoadLayout("CharacterSetupMenu.layout", nullptr);
	
	if(progressBar.GetWindow() == NULL)
	{
		CEGUI::Window* progressWindow = CEGUI::WindowManager::getSingleton().createWindow("Generic/Image", "CursorProgress");
		progressWindow->setSize( CEGUI::USize(CEGUI::UDim( 0.1f, 0 ), CEGUI::UDim( 0.1f, 0 ) ) );
		progressWindow->setPosition( CEGUI::UVector2(CEGUI::UDim( 0.5f, 0 ), CEGUI::UDim( 0.5f, 0 ) ) );
		progressWindow->setAlwaysOnTop(true);
		progressWindow->setMousePassThroughEnabled(true);

		guiManager->GetRootWindow()->addChild(progressWindow);
		progressBar.SetWindow(progressWindow);
		progressWindow->setVisible(true);
	}

	handlers[Screens::MainMenu] = new MainMenuHandler(this);
	//handlers[Screens::CharacterSetup] = new CharacterMenuHandler(this);
	handlers[Screens::GameSetup] = new GameSetupMenuHandler(this);
	handlers[Screens::Tutorial] = new TutorialMenuHandler(this);

	for (unsigned int i = 0; i < Screens::Count; i++)
	{
		handlers[i]->Hide();
	}

	//currentScreen = GameSetup;
	handlers[currentScreen]->Show();

	InputManager* inputManager = InputManager::GetInstance();

	KinectSpeechReader* speechReader = inputManager->GetSpeechReader();
	if(speechReader)
	{
		inputManager->RegisterAudioListener(&player1Nav);
		//Load the grammar for this scene
		if(!speechReader->LoadGrammarFile("MenusSpeech.grxml"))
			printf("Grammer Load Fail\n");
		//Set the confidence threshold
		speechReader->SetConfidenceThreshold(0.6f);
	}

	ogreSceneManager->setAmbientLight(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 1.0f));

	CreateCameraAndViewport(Ogre::ColourValue(0.0f, 0.0f, 0.0f, 0.0f));

}