MCPcopy Create free account
hub / github.com/MyGUI/mygui / createControllerPosition

Method createControllerPosition

Demos/Demo_Controllers/State.cpp:187–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 }
186
187 MyGUI::ControllerPosition* State::createControllerPosition(const MyGUI::IntPoint& _point)
188 {
189 MyGUI::ControllerItem* item =
190 MyGUI::ControllerManager::getInstance().createItem(MyGUI::ControllerPosition::getClassTypeName());
191 MyGUI::ControllerPosition* controller = item->castType<MyGUI::ControllerPosition>();
192
193 controller->setPosition(_point);
194 controller->setTime(0.5);
195
196 if (mType == ControllerType::Inertional)
197 controller->setAction(MyGUI::newDelegate(MyGUI::action::inertionalMoveFunction));
198 else if (mType == ControllerType::Accelerated)
199 controller->setAction(MyGUI::newDelegate(MyGUI::action::acceleratedMoveFunction<30>));
200 else if (mType == ControllerType::Slowed)
201 controller->setAction(MyGUI::newDelegate(MyGUI::action::acceleratedMoveFunction<4>));
202 else
203 controller->setAction(MyGUI::newDelegate(MyGUI::action::jumpMoveFunction<5>));
204
205 return controller;
206 }
207
208 MyGUI::ControllerFadeAlpha* State::createControllerFadeAlpha(float _alpha, float _coef, bool _enable)
209 {

Callers

nothing calls this directly

Calls 6

getClassTypeNameFunction · 0.85
newDelegateFunction · 0.85
createItemMethod · 0.80
setActionMethod · 0.80
setPositionMethod · 0.45
setTimeMethod · 0.45

Tested by

no test coverage detected