void CIwMapGame::SetActiveUI(CIwUIElement* pDialogTemplate, IIwUIEventHandler* pEventHandler) { if (g_pDialogCurrent) { g_pDialogCurrent->SetVisible(false); } if (pEventHandler) { IwGetUIController()->AddEventHandler(pEventHandler); } g_pDialogCurrent = pDialogTemplate; IwGetUIAnimManager()->StopAnim(pDialogTemplate); pDialogTemplate->SetVisible(false); switch (g_direction) { case AnimDir_Left : { IwGetUIAnimManager()->PlayAnim("slideInAnim", pDialogTemplate, false); } break; case AnimDir_Right : { IwGetUIAnimManager()->PlayAnim("slideOutAnim", pDialogTemplate, false); } break; default : { IwGetUIAnimManager()->PlayAnim("zoominAnim", pDialogTemplate, false); pDialogTemplate->SetVisible(true); } break; } }
//----------------------------------------------------------------------------- void ExampleShutDown() { delete IwGetUIController(); delete IwGetUIView(); //Terminate the IwUI module IwUITerminate(); }
//----------------------------------------------------------------------------- bool ExampleUpdate() { //Update the controller (this will generate control events etc.) IwGetUIController()->Update(); //Update the view (this will do animations etc.) The example framework has //a fixed framerate of 20fps, so we pass that duration to the update function. IwGetUIView()->Update(1000/20); return true; }