Kiwano Engine
v1.3.x
Transition.h
1
// Copyright (c) 2016-2018 Kiwano - Nomango
2
//
3
// Permission is hereby granted, free of charge, to any person obtaining a copy
4
// of this software and associated documentation files (the "Software"), to deal
5
// in the Software without restriction, including without limitation the rights
6
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
// copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in
11
// all copies or substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
// THE SOFTWARE.
20
21
#pragma once
22
#include <kiwano/2d/Stage.h>
23
#include <kiwano/render/Layer.h>
24
25
namespace
kiwano
26
{
27
class
Director;
28
class
RenderContext;
29
44
class
KGE_API
Transition
:
public
ObjectBase
45
{
46
friend
class
Director
;
47
48
public
:
49
Transition
();
50
51
virtual
~Transition
();
52
57
void
SetDuration(
Duration
dt);
58
63
bool
IsDone();
64
65
protected
:
72
virtual
void
Init(
Stage
* prev,
Stage
* next);
73
79
virtual
void
Update(
Duration
dt);
80
86
virtual
void
Render(
RenderContext
& ctx);
87
92
virtual
void
Stop();
93
98
virtual
void
Reset
() {}
99
100
protected
:
101
bool
done_;
102
float
process_;
103
Duration
duration_;
104
Duration
delta_;
105
Size
window_size_;
106
RefPtr<Stage>
out_stage_;
107
RefPtr<Stage>
in_stage_;
108
Layer
out_layer_;
109
Layer
in_layer_;
110
};
111
114
inline
void
Transition::SetDuration
(
Duration
dt)
115
{
116
duration_ = dt;
117
}
118
119
}
// namespace kiwano
kiwano::Director
导演
Definition:
Director.h:38
kiwano::Layer
图层
Definition:
Layer.h:37
kiwano::ObjectBase
基础对象
Definition:
ObjectBase.h:138
kiwano::RefBasePtr
引用计数智能指针
Definition:
RefBasePtr.hpp:35
kiwano::RenderContext
渲染上下文
Definition:
RenderContext.h:62
kiwano::Stage
舞台
Definition:
Stage.h:40
kiwano::Transition
舞台过渡动画
Definition:
Transition.h:45
kiwano::Transition::SetDuration
void SetDuration(Duration dt)
设置动画时长
Definition:
Transition.h:114
kiwano::Transition::Reset
virtual void Reset()
重置动画
Definition:
Transition.h:98
kiwano::Duration
时间段
Definition:
Duration.h:48
kiwano::math::Vec2T< float >
src
kiwano
2d
transition
Transition.h
制作者
1.9.4