MyGUI 3.2.0

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

- File List
- Globals

MyGUI_ActionController.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_ACTION_CONTROLLER_H__
23 #define __MYGUI_ACTION_CONTROLLER_H__
24
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Types.h"
27 #include <math.h>
28
29 namespace MyGUI
30 {
31
32 namespace action
33 {
34
36 void MYGUI_EXPORT actionWidgetHide(Widget* _widget);
37
39 void MYGUI_EXPORT actionWidgetShow(Widget* _widget);
40
42 void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget);
43
45 void MYGUI_EXPORT linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k);
46
52 template <int N>
53 inline void acceleratedMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
54 {
55 float k = (float)pow (_current_time, N / 10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/);
56 linearMoveFunction(_startRect, _destRect, _result, k);
57 }
58
60 template <int N>
61 inline void jumpMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
62 {
63 float k = pow (_current_time, 2) * (-2 - N / 10.f) + _current_time * (3 + N / 10.f);
64 linearMoveFunction(_startRect, _destRect, _result, k);
65 }
66
68 void MYGUI_EXPORT inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time);
69
70 } // namespace action
71
72 } // namespace MyGUI
73
74 #endif // __MYGUI_ACTION_CONTROLLER_H__
MyGUI::types::TCoord
Definition: MyGUI_TCoord.h:35
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI_Prerequest.h
MyGUI::action::inertionalMoveFunction
void inertionalMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.cpp:59
MyGUI::action::linearMoveFunction
void linearMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _k)
Definition: MyGUI_ActionController.cpp:49
MyGUI_Types.h
MyGUI::action::acceleratedMoveFunction
void acceleratedMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.h:53
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::action::actionWidgetDestroy
void actionWidgetDestroy(Widget *_widget)
Definition: MyGUI_ActionController.cpp:44
MyGUI::action::jumpMoveFunction
void jumpMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
Definition: MyGUI_ActionController.h:61
MyGUI::action::actionWidgetHide
void actionWidgetHide(Widget *_widget)
Definition: MyGUI_ActionController.cpp:34
MyGUI::action::actionWidgetShow
void actionWidgetShow(Widget *_widget)
Definition: MyGUI_ActionController.cpp:39