MyGUI 3.5.3
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 <cmath>
13
14namespace MyGUI
15{
16
17 class ControllerItem;
18
19 namespace action
20 {
21
23 void MYGUI_EXPORT actionWidgetHide(Widget* _widget, ControllerItem* _controller);
24
26 void MYGUI_EXPORT actionWidgetShow(Widget* _widget, ControllerItem* _controller);
27
29 void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget, ControllerItem* _controller);
30
33 linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k);
34
40 template<int N>
42 const IntCoord& _startRect,
43 const IntCoord& _destRect,
45 float _current_time)
46 {
47 float k = std::pow(_current_time, N / 10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/);
48 linearMoveFunction(_startRect, _destRect, _result, k);
49 }
50
52 template<int N>
53 inline void jumpMoveFunction(
54 const IntCoord& _startRect,
55 const IntCoord& _destRect,
57 float _current_time)
58 {
59 float k = std::pow(_current_time, 2.0f) * (-2 - N / 10.f) + _current_time * (3 + N / 10.f);
60 linearMoveFunction(_startRect, _destRect, _result, k);
61 }
62
65 const IntCoord& _startRect,
66 const IntCoord& _destRect,
69
70 } // namespace action
71} // namespace MyGUI
72
73#endif // MYGUI_ACTION_CONTROLLER_H_
#define MYGUI_EXPORT
void acceleratedMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
void actionWidgetDestroy(Widget *_widget, ControllerItem *_controller)
void const IntCoord IntCoord float _k
void ControllerItem * _controller
void jumpMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
void const IntCoord & _destRect
void linearMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _k)
void const IntCoord IntCoord float _current_time
void inertionalMoveFunction(const IntCoord &_startRect, const IntCoord &_destRect, IntCoord &_result, float _current_time)
void const IntCoord IntCoord & _result
void actionWidgetHide(Widget *_widget, ControllerItem *_controller)
void actionWidgetShow(Widget *_widget, ControllerItem *_controller)
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:35