6
#include "Precompiled.h"
7
#include "DemoKeeper.h"
13
DemoKeeper::DemoKeeper() :
22
void DemoKeeper::setupResources()
24
base::BaseManager::setupResources();
25
addResourceLocation(getRootMedia() + "/Demos/Demo_Controllers");
26
addResourceLocation(getRootMedia() + "/Common/Demos");
29
void DemoKeeper::createScene()
31
MyGUI::LayoutManager::getInstance().loadLayout("Wallpaper.layout");
32
const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
33
root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption("ControllerFadeAlpha and ControllerPosition examples.");
37
mMenu1 = new State("Menu1.layout", ControllerType::Inertional);
38
mMenu1->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
40
mMenu2 = new State("Menu2.layout", ControllerType::Accelerated);
41
mMenu2->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
43
mMenu3 = new State("Menu3.layout", ControllerType::Slowed);
44
mMenu3->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
46
mMenu4 = new State("Menu4.layout", ControllerType::Jump);
47
mMenu4->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
49
mMenu1->setVisible(true);
50
mType = ControllerType::Inertional;
53
void DemoKeeper::destroyScene()
65
void DemoKeeper::notifyButtonPress(ControllerType _type, bool _complite)
73
if (mType == _type || mIsAnim) return;
76
if (mType == ControllerType::Inertional) mMenu1->setVisible(false);
77
else if (mType == ControllerType::Accelerated) mMenu2->setVisible(false);
78
else if (mType == ControllerType::Slowed) mMenu3->setVisible(false);
79
else if (mType == ControllerType::Jump) mMenu4->setVisible(false);
83
if (mType == ControllerType::Inertional) mMenu1->setVisible(true);
84
else if (mType == ControllerType::Accelerated) mMenu2->setVisible(true);
85
else if (mType == ControllerType::Slowed) mMenu3->setVisible(true);
86
else if (mType == ControllerType::Jump) mMenu4->setVisible(true);
91
MYGUI_APP(demo::DemoKeeper)
6
#include "Precompiled.h"
7
#include "DemoKeeper.h"
13
DemoKeeper::DemoKeeper() :
22
void DemoKeeper::setupResources()
24
base::BaseManager::setupResources();
25
addResourceLocation(getRootMedia() + "/Demos/Demo_Controllers");
26
addResourceLocation(getRootMedia() + "/Common/Demos");
29
void DemoKeeper::createScene()
31
base::BaseDemoManager::createScene();
32
MyGUI::LayoutManager::getInstance().loadLayout("Wallpaper.layout");
33
const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
35
root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption("ControllerFadeAlpha and ControllerPosition examples.");
39
mMenu1 = new State("Menu1.layout", ControllerType::Inertional);
40
mMenu1->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
42
mMenu2 = new State("Menu2.layout", ControllerType::Accelerated);
43
mMenu2->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
45
mMenu3 = new State("Menu3.layout", ControllerType::Slowed);
46
mMenu3->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
48
mMenu4 = new State("Menu4.layout", ControllerType::Jump);
49
mMenu4->eventButtonPress = MyGUI::newDelegate(this, &DemoKeeper::notifyButtonPress);
51
mMenu1->setVisible(true);
52
mType = ControllerType::Inertional;
55
void DemoKeeper::destroyScene()
67
void DemoKeeper::notifyButtonPress(ControllerType _type, bool _complite)
75
if (mType == _type || mIsAnim) return;
78
if (mType == ControllerType::Inertional) mMenu1->setVisible(false);
79
else if (mType == ControllerType::Accelerated) mMenu2->setVisible(false);
80
else if (mType == ControllerType::Slowed) mMenu3->setVisible(false);
81
else if (mType == ControllerType::Jump) mMenu4->setVisible(false);
85
if (mType == ControllerType::Inertional) mMenu1->setVisible(true);
86
else if (mType == ControllerType::Accelerated) mMenu2->setVisible(true);
87
else if (mType == ControllerType::Slowed) mMenu3->setVisible(true);
88
else if (mType == ControllerType::Jump) mMenu4->setVisible(true);
93
MYGUI_APP(demo::DemoKeeper)