MyGUI 3.2.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_ActionController.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_ACTION_CONTROLLER_H_
8 #define MYGUI_ACTION_CONTROLLER_H_
9
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Types.h"
12 #include <math.h>
13
14 namespace MyGUI
15 {
16 class ControllerItem;
17
18 namespace action
19 {
20
22 void MYGUI_EXPORT actionWidgetHide(Widget* _widget, ControllerItem* _controller);
23
25 void MYGUI_EXPORT actionWidgetShow(Widget* _widget, ControllerItem* _controller);
26
28 void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget, ControllerItem* _controller);
29
31 void MYGUI_EXPORT linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k);
32
38 template <int N>
39 inline void acceleratedMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
40 {
41 float k = (float)pow (_current_time, N / 10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/);
42 linearMoveFunction(_startRect, _destRect, _result, k);
43 }
44
46 template <int N>
47 inline void jumpMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
48 {
49 float k = pow (_current_time, 2) * (-2 - N / 10.f) + _current_time * (3 + N / 10.f);
50 linearMoveFunction(_startRect, _destRect, _result, k);
51 }
52
54 void MYGUI_EXPORT inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time);
55
56 } // namespace action
57
58 } // namespace MyGUI
59
60 #endif // MYGUI_ACTION_CONTROLLER_H_
MyGUI::types::TCoord
Definition: MyGUI_TCoord.h:20
MyGUI::Widget
Widget properties. Widget_skin_childs Skin childs. Widget widget description should be here...
Definition: MyGUI_Widget.h:29
MyGUI_Prerequest.h
MyGUI::action::actionWidgetHide
void actionWidgetHide(Widget *_widget, ControllerItem *_controller)
Definition: MyGUI_ActionController.cpp:18
MyGUI::action::inertionalMoveFunction
void inertionalMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.cpp:42
MyGUI::action::actionWidgetDestroy
void actionWidgetDestroy(Widget *_widget, ControllerItem *_controller)
Definition: MyGUI_ActionController.cpp:28
MyGUI::action::linearMoveFunction
void linearMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _k)
Definition: MyGUI_ActionController.cpp:33
MyGUI_Types.h
MyGUI::action::acceleratedMoveFunction
void acceleratedMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.h:39
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::action::jumpMoveFunction
void jumpMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.h:47
MyGUI::action::actionWidgetShow
void actionWidgetShow(Widget *_widget, ControllerItem *_controller)
Definition: MyGUI_ActionController.cpp:23
MyGUI::ControllerItem
Definition: MyGUI_ControllerItem.h:25