Tween supports Animation now

This commit is contained in:
Nomango 2019-01-26 17:18:31 +08:00 committed by Nomango
parent 5b0cd1969f
commit d223cd60ae
16 changed files with 135 additions and 207 deletions

View File

@ -36,22 +36,22 @@ namespace easy2d
virtual ~Loop(); virtual ~Loop();
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
// 重置动作 // 重置动作
virtual void Reset() override; void Reset() override;
virtual bool IsRunning() override; bool IsRunning() override;
protected: protected:
// 初始化动作 // 初始化动作
virtual void Init(Node* target) override; void Init(Node* target) override;
// 更新动作 // 更新动作
virtual void Update(Node* target, Duration dt) override; void Update(Node* target, Duration dt) override;
protected: protected:
ActionPtr action_; ActionPtr action_;
@ -84,20 +84,20 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
// 重置动作 // 重置动作
virtual void Reset() override; void Reset() override;
protected: protected:
// 初始化动作 // 初始化动作
virtual void Init(Node* target) override; void Init(Node* target) override;
// 更新动作 // 更新动作
virtual void Update(Node* target, Duration dt) override; void Update(Node* target, Duration dt) override;
protected: protected:
UINT action_index_; UINT action_index_;
@ -129,20 +129,20 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const; virtual ActionPtr Reverse() const;
// 重置动作 // 重置动作
virtual void Reset() override; void Reset() override;
protected: protected:
// 初始化动作 // 初始化动作
virtual void Init(Node* target) override; void Init(Node* target) override;
// 更新动作 // 更新动作
virtual void Update(Node* target, Duration dt) override; void Update(Node* target, Duration dt) override;
protected: protected:
Array<ActionPtr> actions_; Array<ActionPtr> actions_;

View File

@ -21,6 +21,7 @@
#pragma once #pragma once
#include "ActionGroup.h" #include "ActionGroup.h"
#include "ActionTween.h" #include "ActionTween.h"
#include "Animation.h"
#include "Delay.h" #include "Delay.h"
namespace easy2d namespace easy2d
@ -38,6 +39,7 @@ namespace easy2d
return base; return base;
} }
private:
ActionPtr base; ActionPtr base;
int loop; int loop;
}; };
@ -61,6 +63,7 @@ namespace easy2d
return base; return base;
} }
private:
ActionTweenPtr base; ActionTweenPtr base;
Duration dur; Duration dur;
int loop; int loop;
@ -170,6 +173,12 @@ namespace easy2d
return TweenActionHelper(new easy2d::PathAction(0, geo, rotating, start, end)); return TweenActionHelper(new easy2d::PathAction(0, geo, rotating, start, end));
} }
static inline TweenActionHelper
Animation(FramesPtr const& frames)
{
return TweenActionHelper(new easy2d::Animation(0, frames));
}
static inline ActionHelper static inline ActionHelper
Delay(Duration dur) Delay(Duration dur)
{ {

View File

@ -25,7 +25,7 @@ namespace easy2d
{ {
void ActionManager::UpdateActions(Node* target, Duration dt) void ActionManager::UpdateActions(Node* target, Duration dt)
{ {
if (actions_.IsEmpty()) if (actions_.IsEmpty() || !target)
return; return;
ActionPtr next; ActionPtr next;

View File

@ -223,16 +223,13 @@ namespace easy2d
void MoveBy::UpdateStep(Node* target, float step) void MoveBy::UpdateStep(Node* target, float step)
{ {
if (target) Point diff = target->GetPosition() - prev_pos_;
{ start_pos_ = start_pos_ + diff;
Point diff = target->GetPosition() - prev_pos_;
start_pos_ = start_pos_ + diff;
Point new_pos = start_pos_ + (delta_pos_ * step); Point new_pos = start_pos_ + (delta_pos_ * step);
target->SetPosition(new_pos); target->SetPosition(new_pos);
prev_pos_ = new_pos; prev_pos_ = new_pos;
}
} }
ActionPtr MoveBy::Clone() const ActionPtr MoveBy::Clone() const
@ -297,21 +294,18 @@ namespace easy2d
void JumpBy::UpdateStep(Node* target, float step) void JumpBy::UpdateStep(Node* target, float step)
{ {
if (target) float frac = fmod(step * jumps_, 1.f);
{ float x = delta_pos_.x * step;
float frac = fmod(step * jumps_, 1.f); float y = height_ * 4 * frac * (1 - frac);
float x = delta_pos_.x * step; y += delta_pos_.y * step;
float y = height_ * 4 * frac * (1 - frac);
y += delta_pos_.y * step;
Point diff = target->GetPosition() - prev_pos_; Point diff = target->GetPosition() - prev_pos_;
start_pos_ = diff + start_pos_; start_pos_ = diff + start_pos_;
Point new_pos = start_pos_ + Point(x, y); Point new_pos = start_pos_ + Point(x, y);
target->SetPosition(new_pos); target->SetPosition(new_pos);
prev_pos_ = new_pos; prev_pos_ = new_pos;
}
} }
JumpTo::JumpTo(Duration duration, Point const& pos, float height, int jumps, EaseFunc func) JumpTo::JumpTo(Duration duration, Point const& pos, float height, int jumps, EaseFunc func)
@ -363,10 +357,7 @@ namespace easy2d
void ScaleBy::UpdateStep(Node* target, float step) void ScaleBy::UpdateStep(Node* target, float step)
{ {
if (target) target->SetScale(start_scale_x_ + delta_x_ * step, start_scale_y_ + delta_y_ * step);
{
target->SetScale(start_scale_x_ + delta_x_ * step, start_scale_y_ + delta_y_ * step);
}
} }
ActionPtr ScaleBy::Clone() const ActionPtr ScaleBy::Clone() const
@ -428,10 +419,7 @@ namespace easy2d
void OpacityBy::UpdateStep(Node* target, float step) void OpacityBy::UpdateStep(Node* target, float step)
{ {
if (target) target->SetOpacity(start_val_ + delta_val_ * step);
{
target->SetOpacity(start_val_ + delta_val_ * step);
}
} }
ActionPtr OpacityBy::Clone() const ActionPtr OpacityBy::Clone() const
@ -494,10 +482,7 @@ namespace easy2d
void RotateBy::UpdateStep(Node* target, float step) void RotateBy::UpdateStep(Node* target, float step)
{ {
if (target) target->SetRotation(start_val_ + delta_val_ * step);
{
target->SetRotation(start_val_ + delta_val_ * step);
}
} }
ActionPtr RotateBy::Clone() const ActionPtr RotateBy::Clone() const
@ -563,21 +548,18 @@ namespace easy2d
void PathAction::UpdateStep(Node* target, float step) void PathAction::UpdateStep(Node* target, float step)
{ {
if (target) float length = geo_->GetLength() * std::min(std::max((end_ - start_) * step + start_, 0.f), 1.f);
Point point, tangent;
if (geo_->ComputePointAt(length, &point, &tangent))
{ {
float length = geo_->GetLength() * std::min(std::max((end_ - start_) * step + start_, 0.f), 1.f); target->SetPosition(start_pos_ + point);
Point point, tangent; if (rotating_)
if (geo_->ComputePointAt(length, &point, &tangent))
{ {
target->SetPosition(start_pos_ + point); float ac = math::Acos(tangent.x);
float rotation = (tangent.y < 0.f) ? 360.f - ac : ac;
if (rotating_) target->SetRotation(rotation);
{
float ac = math::Acos(tangent.x);
float rotation = (tangent.y < 0.f) ? 360.f - ac : ac;
target->SetRotation(rotation);
}
} }
} }
} }

View File

@ -95,16 +95,16 @@ namespace easy2d
EaseFunction func EaseFunction func
); );
virtual void Reset() override; void Reset() override;
Duration GetDuration() const; Duration GetDuration() const;
void SetDuration(Duration duration); void SetDuration(Duration duration);
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void Update(Node* target, Duration dt) override; void Update(Node* target, Duration dt) override;
virtual void UpdateStep(Node* target, float step) = 0; virtual void UpdateStep(Node* target, float step) = 0;
@ -128,15 +128,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
Point start_pos_; Point start_pos_;
@ -157,7 +157,7 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override virtual ActionPtr Reverse() const override
@ -167,7 +167,7 @@ namespace easy2d
} }
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
protected: protected:
Point end_pos_; Point end_pos_;
@ -188,15 +188,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
Point start_pos_; Point start_pos_;
@ -221,7 +221,7 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override virtual ActionPtr Reverse() const override
@ -231,7 +231,7 @@ namespace easy2d
} }
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
protected: protected:
Point end_pos_; Point end_pos_;
@ -257,15 +257,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
float start_scale_x_; float start_scale_x_;
@ -294,7 +294,7 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override virtual ActionPtr Reverse() const override
@ -304,7 +304,7 @@ namespace easy2d
} }
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
protected: protected:
float end_scale_x_; float end_scale_x_;
@ -324,15 +324,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
float start_val_; float start_val_;
@ -352,7 +352,7 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override virtual ActionPtr Reverse() const override
@ -362,7 +362,7 @@ namespace easy2d
} }
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
protected: protected:
float end_val_; float end_val_;
@ -407,15 +407,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
float start_val_; float start_val_;
@ -435,7 +435,7 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override virtual ActionPtr Reverse() const override
@ -445,7 +445,7 @@ namespace easy2d
} }
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
protected: protected:
float end_val_; float end_val_;
@ -467,15 +467,15 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void UpdateStep(Node* target, float step) override; void UpdateStep(Node* target, float step) override;
protected: protected:
bool rotating_; bool rotating_;

View File

@ -26,13 +26,12 @@
namespace easy2d namespace easy2d
{ {
Animation::Animation() Animation::Animation()
: frame_index_(0) : frames_(nullptr)
, frames_(nullptr)
{ {
} }
Animation::Animation(FramesPtr const& animation) Animation::Animation(Duration duration, FramesPtr const& animation, EaseFunc func)
: frame_index_(0) : ActionTween(duration, func)
, frames_(nullptr) , frames_(nullptr)
{ {
this->SetAnimation(animation); this->SetAnimation(animation);
@ -52,65 +51,42 @@ namespace easy2d
if (animation && animation != frames_) if (animation && animation != frames_)
{ {
frames_ = animation; frames_ = animation;
frame_index_ = 0;
} }
} }
void Animation::Init(Node* target) void Animation::Init(Node* target)
{ {
Action::Init(target); ActionTween::Init(target);
auto sprite_target = dynamic_cast<Sprite*>(target); if (!frames_ || frames_->GetFrames().empty())
if (sprite_target && frames_)
{
sprite_target->Load(frames_->GetFrames()[frame_index_]);
++frame_index_;
}
}
void Animation::Update(Node* target, Duration dt)
{
Action::Update(target, dt);
if (!frames_)
{ {
this->Stop(); this->Stop();
return; return;
} }
delta_ += dt; auto sprite_target = dynamic_cast<Sprite*>(target);
while (delta_ >= frames_->GetInterval()) if (sprite_target && frames_)
{ {
auto& frames = frames_->GetFrames(); sprite_target->Load(frames_->GetFrames()[0]);
auto sprite_target = dynamic_cast<Sprite*>(target);
if (sprite_target)
{
sprite_target->Load(frames[frame_index_]);
}
delta_ -= frames_->GetInterval();
++frame_index_;
if (frame_index_ == frames.size())
{
this->Stop();
break;
}
} }
} }
void Animation::Reset() void Animation::UpdateStep(Node * target, float step)
{ {
Action::Reset(); E2D_ASSERT(dynamic_cast<Sprite*>(target) && "Animation only supports Sprites");
frame_index_ = 0;
const auto& frames = frames_->GetFrames();
size_t size = frames.size();
size_t index = std::min(static_cast<size_t>(math::Floor(size * step)), size - 1);
static_cast<Sprite*>(target)->Load(frames[index]);
} }
ActionPtr Animation::Clone() const ActionPtr Animation::Clone() const
{ {
if (frames_) if (frames_)
{ {
return new (std::nothrow) Animation(frames_); return new (std::nothrow) Animation(duration_, frames_, ease_type_);
} }
return nullptr; return nullptr;
} }
@ -119,10 +95,10 @@ namespace easy2d
{ {
if (frames_) if (frames_)
{ {
auto animation = frames_->Reverse(); FramesPtr frames = frames_->Reverse();
if (animation) if (frames)
{ {
return new (std::nothrow) Animation(animation); return new (std::nothrow) Animation(duration_, frames, ease_type_);
} }
} }
return nullptr; return nullptr;

View File

@ -19,19 +19,21 @@
// THE SOFTWARE. // THE SOFTWARE.
#pragma once #pragma once
#include "Action.hpp" #include "ActionTween.h"
namespace easy2d namespace easy2d
{ {
// 帧动画 // 帧动画
class Animation class Animation
: public Action : public ActionTween
{ {
public: public:
Animation(); Animation();
explicit Animation( Animation(
FramesPtr const& animation Duration duration, /* 动画时长 */
FramesPtr const& frames, /* 帧集合 */
EaseFunc func = EaseFunc::Linear
); );
virtual ~Animation(); virtual ~Animation();
@ -45,24 +47,17 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
// 重置动作
virtual void Reset() override;
protected: protected:
// 初始化动作 void Init(Node* target) override;
virtual void Init(Node* target) override;
// 更新动作 void UpdateStep(Node* target, float step) override;
virtual void Update(Node* target, Duration dt) override;
protected: protected:
size_t frame_index_;
Duration delta_;
FramesPtr frames_; FramesPtr frames_;
}; };
} }

View File

@ -218,7 +218,7 @@ namespace easy2d
// 导出为图片 // 导出为图片
ImagePtr ExportToImage() const; ImagePtr ExportToImage() const;
virtual void OnRender() override; void OnRender() override;
protected: protected:
D2DBitmapPtr const& GetBitmap() const; D2DBitmapPtr const& GetBitmap() const;

View File

@ -33,18 +33,18 @@ namespace easy2d
); );
// 获取该动作的拷贝对象 // 获取该动作的拷贝对象
virtual ActionPtr Clone() const override; ActionPtr Clone() const override;
// 获取该动作的倒转 // 获取该动作的倒转
virtual ActionPtr Reverse() const override; ActionPtr Reverse() const override;
// 重置动作 // 重置动作
virtual void Reset() override; void Reset() override;
protected: protected:
virtual void Init(Node* target) override; void Init(Node* target) override;
virtual void Update(Node* target, Duration dt) override; void Update(Node* target, Duration dt) override;
protected: protected:
Duration delay_; Duration delay_;

View File

@ -25,18 +25,10 @@
namespace easy2d namespace easy2d
{ {
Frames::Frames() Frames::Frames()
: interval_(200)
{ {
} }
Frames::Frames(Array<ImagePtr> const& frames) Frames::Frames(Array<ImagePtr> const& frames)
: interval_(200)
{
this->Add(frames);
}
Frames::Frames(Duration interval, Array<ImagePtr> const& frames)
: interval_(interval)
{ {
this->Add(frames); this->Add(frames);
} }
@ -45,11 +37,6 @@ namespace easy2d
{ {
} }
void Frames::SetInterval(Duration interval)
{
interval_ = interval;
}
void Frames::Add(ImagePtr const& frame) void Frames::Add(ImagePtr const& frame)
{ {
E2D_ASSERT(frame && "Frames::Add failed, NULL pointer exception"); E2D_ASSERT(frame && "Frames::Add failed, NULL pointer exception");
@ -68,11 +55,6 @@ namespace easy2d
} }
} }
Duration Frames::GetInterval() const
{
return interval_;
}
Array<ImagePtr> const& Frames::GetFrames() const Array<ImagePtr> const& Frames::GetFrames() const
{ {
return frames_; return frames_;
@ -83,7 +65,6 @@ namespace easy2d
auto animation = new (std::nothrow) Frames; auto animation = new (std::nothrow) Frames;
if (animation) if (animation)
{ {
animation->SetInterval(interval_);
for (const auto& frame : frames_) for (const auto& frame : frames_)
{ {
animation->Add(frame); animation->Add(frame);
@ -97,7 +78,6 @@ namespace easy2d
auto animation = new (std::nothrow) Frames; auto animation = new (std::nothrow) Frames;
if (!frames_.empty()) if (!frames_.empty())
{ {
animation->SetInterval(interval_);
for (auto iter = frames_.crbegin(), crend = frames_.crend(); iter != crend; ++iter) for (auto iter = frames_.crbegin(), crend = frames_.crend(); iter != crend; ++iter)
{ {
if (*iter) if (*iter)

View File

@ -35,11 +35,6 @@ namespace easy2d
Array<ImagePtr> const& frames /* 关键帧数组 */ Array<ImagePtr> const& frames /* 关键帧数组 */
); );
explicit Frames(
Duration interval, /* 帧间隔 */
Array<ImagePtr> const& frames /* 关键帧数组 */
);
virtual ~Frames(); virtual ~Frames();
// 添加关键帧 // 添加关键帧
@ -52,17 +47,9 @@ namespace easy2d
Array<ImagePtr> const& frames Array<ImagePtr> const& frames
); );
// 获取帧间隔
Duration GetInterval() const;
// 获取关键帧 // 获取关键帧
Array<ImagePtr> const& GetFrames() const; Array<ImagePtr> const& GetFrames() const;
// 设置每一帧的时间间隔
void SetInterval(
Duration interval
);
// 获取帧动画的拷贝对象 // 获取帧动画的拷贝对象
FramesPtr Clone() const; FramesPtr Clone() const;
@ -70,7 +57,6 @@ namespace easy2d
FramesPtr Reverse() const; FramesPtr Reverse() const;
protected: protected:
Duration interval_;
Array<ImagePtr> frames_; Array<ImagePtr> frames_;
}; };
} }

View File

@ -77,7 +77,7 @@ namespace easy2d
// ťńČĄĎßĚőĎཝŃůĘ˝ // ťńČĄĎßĚőĎཝŃůĘ˝
StrokeStyle SetOutlineJoinStyle() const { return outline_join_; } StrokeStyle SetOutlineJoinStyle() const { return outline_join_; }
virtual void OnRender() override; void OnRender() override;
protected: protected:
Color fill_color_; Color fill_color_;

View File

@ -56,7 +56,7 @@ namespace easy2d
virtual void OnRender() {} virtual void OnRender() {}
// 事件分发 // 事件分发
virtual void Dispatch(Event& evt) override; void Dispatch(Event& evt) override;
// 获取显示状态 // 获取显示状态
bool IsVisible() const { return visible_; } bool IsVisible() const { return visible_; }

View File

@ -65,7 +65,7 @@ namespace easy2d
ImagePtr const& GetImage() const; ImagePtr const& GetImage() const;
// äÖȾ¾«Áé // äÖȾ¾«Áé
virtual void OnRender() override; void OnRender() override;
protected: protected:
ImagePtr image_; ImagePtr image_;

View File

@ -199,7 +199,7 @@ namespace easy2d
TextStyle const& style TextStyle const& style
); );
virtual void OnRender() override; void OnRender() override;
protected: protected:
void UpdateLayout(); void UpdateLayout();

View File

@ -81,7 +81,7 @@ namespace easy2d
protected: protected:
// ¸üж¯»­ // ¸üж¯»­
virtual void Update(Duration dt) override; void Update(Duration dt) override;
virtual void Init( virtual void Init(
ScenePtr const& prev, ScenePtr const& prev,
@ -100,7 +100,7 @@ namespace easy2d
); );
protected: protected:
virtual void Update(Duration dt) override; void Update(Duration dt) override;
virtual void Init( virtual void Init(
ScenePtr const& prev, ScenePtr const& prev,
@ -119,7 +119,7 @@ namespace easy2d
); );
protected: protected:
virtual void Update(Duration dt) override; void Update(Duration dt) override;
virtual void Init( virtual void Init(
ScenePtr const& prev, ScenePtr const& prev,
@ -139,14 +139,14 @@ namespace easy2d
); );
protected: protected:
virtual void Update(Duration dt) override; void Update(Duration dt) override;
virtual void Init( virtual void Init(
ScenePtr const& prev, ScenePtr const& prev,
ScenePtr const& next ScenePtr const& next
) override; ) override;
virtual void Reset() override; void Reset() override;
protected: protected:
Direction direction_; Direction direction_;
@ -166,14 +166,14 @@ namespace easy2d
); );
protected: protected:
virtual void Update(Duration dt) override; void Update(Duration dt) override;
virtual void Init( virtual void Init(
ScenePtr const& prev, ScenePtr const& prev,
ScenePtr const& next ScenePtr const& next
) override; ) override;
virtual void Reset() override; void Reset() override;
protected: protected:
float rotation_; float rotation_;