[deploy] Merge pull request #32 from KiwanoEngine/dev
rename Node to Actor, rename Scene to Stage, rename Stage to Director
This commit is contained in:
commit
f461e97b14
|
|
@ -2,7 +2,7 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\kiwano\2d\GifSprite.h" />
|
||||
<ClInclude Include="..\src\kiwano\base\Stage.h" />
|
||||
<ClInclude Include="..\src\kiwano\base\Director.h" />
|
||||
<ClInclude Include="..\src\kiwano\base\types.h" />
|
||||
<ClInclude Include="..\src\kiwano\kiwano.h" />
|
||||
<ClInclude Include="..\src\kiwano\config.h" />
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
<ClInclude Include="..\src\kiwano\2d\GifImage.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Image.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Layer.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Node.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Scene.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Actor.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Stage.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Sprite.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\Text.h" />
|
||||
<ClInclude Include="..\src\kiwano\2d\TextStyle.hpp" />
|
||||
|
|
@ -97,8 +97,8 @@
|
|||
<ClCompile Include="..\src\kiwano\2d\GifSprite.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Image.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Layer.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Node.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Scene.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Actor.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Stage.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Sprite.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Text.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\2d\Transition.cpp" />
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
<ClCompile Include="..\src\kiwano\base\logs.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\Object.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\Resource.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\Stage.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\Director.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\Timer.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\TimerManager.cpp" />
|
||||
<ClCompile Include="..\src\kiwano\base\time.cpp" />
|
||||
|
|
|
|||
|
|
@ -84,12 +84,6 @@
|
|||
<ClInclude Include="..\src\kiwano\2d\Layer.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\2d\Node.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\2d\Scene.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\2d\Sprite.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -267,9 +261,15 @@
|
|||
<ClInclude Include="..\src\kiwano\2d\ShapeNode.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\base\Stage.h">
|
||||
<ClInclude Include="..\src\kiwano\base\Director.h">
|
||||
<Filter>base</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\2d\Actor.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\kiwano\2d\Stage.h">
|
||||
<Filter>2d</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\src\kiwano\ui\Button.cpp">
|
||||
|
|
@ -311,12 +311,6 @@
|
|||
<ClCompile Include="..\src\kiwano\2d\Layer.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\2d\Node.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\2d\Scene.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\2d\Sprite.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -407,8 +401,14 @@
|
|||
<ClCompile Include="..\src\kiwano\2d\ShapeNode.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\base\Stage.cpp">
|
||||
<ClCompile Include="..\src\kiwano\base\Director.cpp">
|
||||
<Filter>base</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\2d\Actor.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\kiwano\2d\Stage.cpp">
|
||||
<Filter>2d</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#include "Action.h"
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
|
|
@ -36,16 +36,16 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void Action::Init(NodePtr target)
|
||||
void Action::Init(ActorPtr target)
|
||||
{
|
||||
}
|
||||
|
||||
void Action::Update(NodePtr target, Duration dt)
|
||||
void Action::Update(ActorPtr target, Duration dt)
|
||||
{
|
||||
Complete(target);
|
||||
}
|
||||
|
||||
void Action::UpdateStep(NodePtr target, Duration dt)
|
||||
void Action::UpdateStep(ActorPtr target, Duration dt)
|
||||
{
|
||||
elapsed_ += dt;
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Action::Complete(NodePtr target)
|
||||
void Action::Complete(ActorPtr target)
|
||||
{
|
||||
if (cb_loop_done_)
|
||||
cb_loop_done_();
|
||||
|
|
@ -99,7 +99,7 @@ namespace kiwano
|
|||
++loops_done_;
|
||||
}
|
||||
|
||||
void Action::Restart(NodePtr target)
|
||||
void Action::Restart(ActorPtr target)
|
||||
{
|
||||
status_ = Status::NotStarted;
|
||||
elapsed_ = 0;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace kiwano
|
|||
// 设置循环次数 (-1 为永久循环)
|
||||
inline void SetLoops(int loops) { loops_ = loops; }
|
||||
|
||||
// 动作结束时移除目标节点
|
||||
// 动作结束时移除目标角色
|
||||
inline void RemoveTargetWhenDone() { detach_target_ = true; }
|
||||
|
||||
// 设置动作结束时的回调函数
|
||||
|
|
@ -100,15 +100,15 @@ namespace kiwano
|
|||
inline ActionCallback GetLoopDoneCallback() const { return cb_loop_done_; }
|
||||
|
||||
protected:
|
||||
virtual void Init(NodePtr target);
|
||||
virtual void Init(ActorPtr target);
|
||||
|
||||
virtual void Update(NodePtr target, Duration dt);
|
||||
virtual void Update(ActorPtr target, Duration dt);
|
||||
|
||||
void UpdateStep(NodePtr target, Duration dt);
|
||||
void UpdateStep(ActorPtr target, Duration dt);
|
||||
|
||||
void Complete(NodePtr target);
|
||||
void Complete(ActorPtr target);
|
||||
|
||||
void Restart(NodePtr target);
|
||||
void Restart(ActorPtr target);
|
||||
|
||||
protected:
|
||||
Status status_;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#include "ActionGroup.h"
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "../base/logs.h"
|
||||
|
||||
namespace kiwano
|
||||
|
|
@ -43,7 +43,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void ActionGroup::Init(NodePtr target)
|
||||
void ActionGroup::Init(ActorPtr target)
|
||||
{
|
||||
if (actions_.IsEmpty())
|
||||
{
|
||||
|
|
@ -64,7 +64,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionGroup::Update(NodePtr target, Duration dt)
|
||||
void ActionGroup::Update(ActorPtr target, Duration dt)
|
||||
{
|
||||
if (sequence_)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -60,10 +60,10 @@ namespace kiwano
|
|||
|
||||
protected:
|
||||
// 初始化动作
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
// 更新动作
|
||||
void Update(NodePtr target, Duration dt) override;
|
||||
void Update(ActorPtr target, Duration dt) override;
|
||||
|
||||
protected:
|
||||
bool sequence_;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace kiwano
|
|||
// 设置动作循环结束时的回调函数
|
||||
inline ActionHelper& SetLoopDoneCallback(ActionCallback const& cb) { base->SetLoopDoneCallback(cb); return (*this); }
|
||||
|
||||
// 动作结束时移除目标节点
|
||||
// 动作结束时移除目标角色
|
||||
inline ActionHelper& RemoveTargetWhenDone() { base->RemoveTargetWhenDone(); return (*this); }
|
||||
|
||||
// 设置名称
|
||||
|
|
@ -76,7 +76,7 @@ namespace kiwano
|
|||
// 设置动作循环结束时的回调函数
|
||||
inline TweenHelper& SetLoopDoneCallback(ActionCallback const& cb) { base->SetLoopDoneCallback(cb); return (*this); }
|
||||
|
||||
// 动作结束时移除目标节点
|
||||
// 动作结束时移除目标角色
|
||||
inline TweenHelper& RemoveTargetWhenDone() { base->RemoveTargetWhenDone(); return (*this); }
|
||||
|
||||
// 设置名称
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#include "ActionManager.h"
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "../base/logs.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
void ActionManager::UpdateActions(NodePtr target, Duration dt)
|
||||
void ActionManager::UpdateActions(ActorPtr target, Duration dt)
|
||||
{
|
||||
if (actions_.IsEmpty() || !target)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace kiwano
|
|||
Actions const& GetAllActions() const;
|
||||
|
||||
protected:
|
||||
void UpdateActions(NodePtr target, Duration dt);
|
||||
void UpdateActions(ActorPtr target, Duration dt);
|
||||
|
||||
protected:
|
||||
Actions actions_;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "ActionTween.h"
|
||||
#include "include-forwards.h"
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
|
|
@ -98,7 +98,7 @@ namespace kiwano
|
|||
return dur_;
|
||||
}
|
||||
|
||||
void ActionTween::Update(NodePtr target, Duration dt)
|
||||
void ActionTween::Update(ActorPtr target, Duration dt)
|
||||
{
|
||||
float percent;
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ namespace kiwano
|
|||
delta_pos_ = vector;
|
||||
}
|
||||
|
||||
void ActionMoveBy::Init(NodePtr target)
|
||||
void ActionMoveBy::Init(ActorPtr target)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
|
|
@ -150,7 +150,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionMoveBy::UpdateTween(NodePtr target, float percent)
|
||||
void ActionMoveBy::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
Point diff = target->GetPosition() - prev_pos_;
|
||||
start_pos_ = start_pos_ + diff;
|
||||
|
|
@ -182,7 +182,7 @@ namespace kiwano
|
|||
return new (std::nothrow) ActionMoveTo(dur_, end_pos_, ease_func_);
|
||||
}
|
||||
|
||||
void ActionMoveTo::Init(NodePtr target)
|
||||
void ActionMoveTo::Init(ActorPtr target)
|
||||
{
|
||||
ActionMoveBy::Init(target);
|
||||
delta_pos_ = end_pos_ - start_pos_;
|
||||
|
|
@ -211,7 +211,7 @@ namespace kiwano
|
|||
return new (std::nothrow) ActionJumpBy(dur_, -delta_pos_, height_, jumps_, ease_func_);
|
||||
}
|
||||
|
||||
void ActionJumpBy::Init(NodePtr target)
|
||||
void ActionJumpBy::Init(ActorPtr target)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
|
|
@ -219,7 +219,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionJumpBy::UpdateTween(NodePtr target, float percent)
|
||||
void ActionJumpBy::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
float frac = fmod(percent * jumps_, 1.f);
|
||||
float x = delta_pos_.x * percent;
|
||||
|
|
@ -246,7 +246,7 @@ namespace kiwano
|
|||
return new (std::nothrow) ActionJumpTo(dur_, end_pos_, height_, jumps_, ease_func_);
|
||||
}
|
||||
|
||||
void ActionJumpTo::Init(NodePtr target)
|
||||
void ActionJumpTo::Init(ActorPtr target)
|
||||
{
|
||||
ActionJumpBy::Init(target);
|
||||
delta_pos_ = end_pos_ - start_pos_;
|
||||
|
|
@ -271,7 +271,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void ActionScaleBy::Init(NodePtr target)
|
||||
void ActionScaleBy::Init(ActorPtr target)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
|
|
@ -280,7 +280,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionScaleBy::UpdateTween(NodePtr target, float percent)
|
||||
void ActionScaleBy::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
target->SetScale(start_scale_x_ + delta_x_ * percent, start_scale_y_ + delta_y_ * percent);
|
||||
}
|
||||
|
|
@ -314,7 +314,7 @@ namespace kiwano
|
|||
return new (std::nothrow) ActionScaleTo(dur_, end_scale_x_, end_scale_y_, ease_func_);
|
||||
}
|
||||
|
||||
void ActionScaleTo::Init(NodePtr target)
|
||||
void ActionScaleTo::Init(ActorPtr target)
|
||||
{
|
||||
ActionScaleBy::Init(target);
|
||||
delta_x_ = end_scale_x_ - start_scale_x_;
|
||||
|
|
@ -334,7 +334,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void ActionFadeTo::Init(NodePtr target)
|
||||
void ActionFadeTo::Init(ActorPtr target)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
|
|
@ -343,7 +343,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionFadeTo::UpdateTween(NodePtr target, float percent)
|
||||
void ActionFadeTo::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
target->SetOpacity(start_val_ + delta_val_ * percent);
|
||||
}
|
||||
|
|
@ -375,7 +375,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void ActionRotateBy::Init(NodePtr target)
|
||||
void ActionRotateBy::Init(ActorPtr target)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
|
|
@ -383,7 +383,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionRotateBy::UpdateTween(NodePtr target, float percent)
|
||||
void ActionRotateBy::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
float rotation = start_val_ + delta_val_ * percent;
|
||||
if (rotation > 360.f)
|
||||
|
|
@ -413,7 +413,7 @@ namespace kiwano
|
|||
return new (std::nothrow) ActionRotateTo(dur_, end_val_, ease_func_);
|
||||
}
|
||||
|
||||
void ActionRotateTo::Init(NodePtr target)
|
||||
void ActionRotateTo::Init(ActorPtr target)
|
||||
{
|
||||
ActionRotateBy::Init(target);
|
||||
delta_val_ = end_val_ - start_val_;
|
||||
|
|
@ -481,7 +481,7 @@ namespace kiwano
|
|||
return false;
|
||||
}
|
||||
|
||||
void ActionPath::Init(NodePtr target)
|
||||
void ActionPath::Init(ActorPtr target)
|
||||
{
|
||||
start_pos_ = target->GetPosition();
|
||||
|
||||
|
|
@ -496,7 +496,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void ActionPath::UpdateTween(NodePtr target, float percent)
|
||||
void ActionPath::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
float length = GetPathLength() * std::min(std::max((end_ - start_) * percent + start_, 0.f), 1.f);
|
||||
|
||||
|
|
@ -647,13 +647,13 @@ namespace kiwano
|
|||
return new ActionCustom(dur_, tween_func_);
|
||||
}
|
||||
|
||||
void ActionCustom::Init(NodePtr target)
|
||||
void ActionCustom::Init(ActorPtr target)
|
||||
{
|
||||
if (!tween_func_)
|
||||
this->Done();
|
||||
}
|
||||
|
||||
void ActionCustom::UpdateTween(NodePtr target, float percent)
|
||||
void ActionCustom::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
if (tween_func_)
|
||||
tween_func_(target, percent);
|
||||
|
|
|
|||
|
|
@ -90,9 +90,9 @@ namespace kiwano
|
|||
void SetDuration(Duration duration);
|
||||
|
||||
protected:
|
||||
void Update(NodePtr target, Duration dt) override;
|
||||
void Update(ActorPtr target, Duration dt) override;
|
||||
|
||||
virtual void UpdateTween(NodePtr target, float percent) = 0;
|
||||
virtual void UpdateTween(ActorPtr target, float percent) = 0;
|
||||
|
||||
protected:
|
||||
Duration dur_;
|
||||
|
|
@ -118,9 +118,9 @@ namespace kiwano
|
|||
ActionPtr Reverse() const override;
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
Point start_pos_;
|
||||
|
|
@ -151,7 +151,7 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
protected:
|
||||
Point end_pos_;
|
||||
|
|
@ -178,9 +178,9 @@ namespace kiwano
|
|||
ActionPtr Reverse() const override;
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
Point start_pos_;
|
||||
|
|
@ -215,7 +215,7 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
protected:
|
||||
Point end_pos_;
|
||||
|
|
@ -247,9 +247,9 @@ namespace kiwano
|
|||
ActionPtr Reverse() const override;
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
float start_scale_x_;
|
||||
|
|
@ -288,7 +288,7 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
protected:
|
||||
float end_scale_x_;
|
||||
|
|
@ -318,9 +318,9 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
float start_val_;
|
||||
|
|
@ -373,9 +373,9 @@ namespace kiwano
|
|||
ActionPtr Reverse() const override;
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
float start_val_;
|
||||
|
|
@ -405,7 +405,7 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
protected:
|
||||
float end_val_;
|
||||
|
|
@ -481,9 +481,9 @@ namespace kiwano
|
|||
inline void SetGeometry(ComPtr<ID2D1PathGeometry> geo) { geo_ = geo; }
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
bool path_beginning_;
|
||||
|
|
@ -502,7 +502,7 @@ namespace kiwano
|
|||
: public ActionTween
|
||||
{
|
||||
public:
|
||||
using TweenFunc = Closure<void(NodePtr, float)>;
|
||||
using TweenFunc = Closure<void(ActorPtr, float)>;
|
||||
|
||||
ActionCustom(
|
||||
Duration duration, /* ³ÖÐøÊ±³¤ */
|
||||
|
|
@ -521,9 +521,9 @@ namespace kiwano
|
|||
}
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
TweenFunc tween_func_;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "Action.h"
|
||||
#include "Scene.h"
|
||||
#include "Stage.h"
|
||||
#include "../base/logs.h"
|
||||
#include "../renderer/render.h"
|
||||
|
||||
|
|
@ -32,13 +32,13 @@ namespace kiwano
|
|||
float default_anchor_y = 0.f;
|
||||
}
|
||||
|
||||
void Node::SetDefaultAnchor(float anchor_x, float anchor_y)
|
||||
void Actor::SetDefaultAnchor(float anchor_x, float anchor_y)
|
||||
{
|
||||
default_anchor_x = anchor_x;
|
||||
default_anchor_y = anchor_y;
|
||||
}
|
||||
|
||||
Node::Node()
|
||||
Actor::Actor()
|
||||
: visible_(true)
|
||||
, update_pausing_(false)
|
||||
, hover_(false)
|
||||
|
|
@ -50,7 +50,7 @@ namespace kiwano
|
|||
, show_border_(false)
|
||||
, is_fast_transform_(true)
|
||||
, parent_(nullptr)
|
||||
, scene_(nullptr)
|
||||
, stage_(nullptr)
|
||||
, hash_name_(0)
|
||||
, z_order_(0)
|
||||
, opacity_(1.f)
|
||||
|
|
@ -59,7 +59,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void Node::Update(Duration dt)
|
||||
void Actor::Update(Duration dt)
|
||||
{
|
||||
if (!update_pausing_)
|
||||
{
|
||||
|
|
@ -74,7 +74,7 @@ namespace kiwano
|
|||
|
||||
if (!children_.IsEmpty())
|
||||
{
|
||||
NodePtr next;
|
||||
ActorPtr next;
|
||||
for (auto child = children_.First(); child; child = next)
|
||||
{
|
||||
next = child->NextItem();
|
||||
|
|
@ -83,7 +83,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::Render()
|
||||
void Actor::Render()
|
||||
{
|
||||
if (!visible_)
|
||||
return;
|
||||
|
|
@ -98,7 +98,7 @@ namespace kiwano
|
|||
else
|
||||
{
|
||||
// render children those are less than 0 in Z-Order
|
||||
Node* child = children_.First().Get();
|
||||
Actor* child = children_.First().Get();
|
||||
while (child)
|
||||
{
|
||||
if (child->GetZOrder() >= 0)
|
||||
|
|
@ -119,7 +119,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::RenderBorder()
|
||||
void Actor::RenderBorder()
|
||||
{
|
||||
if (show_border_)
|
||||
{
|
||||
|
|
@ -137,12 +137,12 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::Dispatch(Event& evt)
|
||||
void Actor::Dispatch(Event& evt)
|
||||
{
|
||||
if (!visible_)
|
||||
return;
|
||||
|
||||
NodePtr prev;
|
||||
ActorPtr prev;
|
||||
for (auto child = children_.Last(); child; child = prev)
|
||||
{
|
||||
prev = child->PrevItem();
|
||||
|
|
@ -198,13 +198,13 @@ namespace kiwano
|
|||
EventDispatcher::Dispatch(evt);
|
||||
}
|
||||
|
||||
Matrix const & Node::GetTransformMatrix() const
|
||||
Matrix const & Actor::GetTransformMatrix() const
|
||||
{
|
||||
UpdateTransform();
|
||||
return transform_matrix_;
|
||||
}
|
||||
|
||||
Matrix const & Node::GetTransformInverseMatrix() const
|
||||
Matrix const & Actor::GetTransformInverseMatrix() const
|
||||
{
|
||||
UpdateTransform();
|
||||
if (dirty_transform_inverse_)
|
||||
|
|
@ -215,7 +215,7 @@ namespace kiwano
|
|||
return transform_matrix_inverse_;
|
||||
}
|
||||
|
||||
void Node::UpdateTransform() const
|
||||
void Actor::UpdateTransform() const
|
||||
{
|
||||
if (!dirty_transform_)
|
||||
return;
|
||||
|
|
@ -246,11 +246,11 @@ namespace kiwano
|
|||
}
|
||||
|
||||
// update children's transform
|
||||
for (Node* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
for (Actor* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
child->dirty_transform_ = true;
|
||||
}
|
||||
|
||||
void Node::UpdateOpacity()
|
||||
void Actor::UpdateOpacity()
|
||||
{
|
||||
if (parent_ && parent_->IsCascadeOpacityEnabled())
|
||||
{
|
||||
|
|
@ -261,33 +261,33 @@ namespace kiwano
|
|||
displayed_opacity_ = opacity_;
|
||||
}
|
||||
|
||||
for (Node* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
for (Actor* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
{
|
||||
child->UpdateOpacity();
|
||||
}
|
||||
}
|
||||
|
||||
void Node::SetScene(Scene* scene)
|
||||
void Actor::SetStage(Stage* scene)
|
||||
{
|
||||
if (scene && scene_ != scene)
|
||||
if (scene && stage_ != scene)
|
||||
{
|
||||
scene_ = scene;
|
||||
for (Node* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
stage_ = scene;
|
||||
for (Actor* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
{
|
||||
child->scene_ = scene;
|
||||
child->stage_ = scene;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Node::Reorder()
|
||||
void Actor::Reorder()
|
||||
{
|
||||
if (parent_)
|
||||
{
|
||||
NodePtr me = this;
|
||||
ActorPtr me = this;
|
||||
|
||||
parent_->children_.Remove(me);
|
||||
|
||||
Node* sibling = parent_->children_.Last().Get();
|
||||
Actor* sibling = parent_->children_.Last().Get();
|
||||
|
||||
if (sibling && sibling->GetZOrder() > z_order_)
|
||||
{
|
||||
|
|
@ -311,7 +311,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::SetZOrder(int zorder)
|
||||
void Actor::SetZOrder(int zorder)
|
||||
{
|
||||
if (z_order_ != zorder)
|
||||
{
|
||||
|
|
@ -320,7 +320,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::SetOpacity(float opacity)
|
||||
void Actor::SetOpacity(float opacity)
|
||||
{
|
||||
if (opacity_ == opacity)
|
||||
return;
|
||||
|
|
@ -329,7 +329,7 @@ namespace kiwano
|
|||
UpdateOpacity();
|
||||
}
|
||||
|
||||
void Node::SetCascadeOpacityEnabled(bool enabled)
|
||||
void Actor::SetCascadeOpacityEnabled(bool enabled)
|
||||
{
|
||||
if (cascade_opacity_ == enabled)
|
||||
return;
|
||||
|
|
@ -338,17 +338,17 @@ namespace kiwano
|
|||
UpdateOpacity();
|
||||
}
|
||||
|
||||
void Node::SetAnchorX(float anchor_x)
|
||||
void Actor::SetAnchorX(float anchor_x)
|
||||
{
|
||||
this->SetAnchor(anchor_x, anchor_.y);
|
||||
}
|
||||
|
||||
void Node::SetAnchorY(float anchor_y)
|
||||
void Actor::SetAnchorY(float anchor_y)
|
||||
{
|
||||
this->SetAnchor(anchor_.x, anchor_y);
|
||||
}
|
||||
|
||||
void Node::SetAnchor(float anchor_x, float anchor_y)
|
||||
void Actor::SetAnchor(float anchor_x, float anchor_y)
|
||||
{
|
||||
if (anchor_.x == anchor_x && anchor_.y == anchor_y)
|
||||
return;
|
||||
|
|
@ -358,27 +358,27 @@ namespace kiwano
|
|||
dirty_transform_ = true;
|
||||
}
|
||||
|
||||
void Node::SetAnchor(Point const& anchor)
|
||||
void Actor::SetAnchor(Point const& anchor)
|
||||
{
|
||||
this->SetAnchor(anchor.x, anchor.y);
|
||||
}
|
||||
|
||||
void Node::SetWidth(float width)
|
||||
void Actor::SetWidth(float width)
|
||||
{
|
||||
this->SetSize(width, size_.y);
|
||||
}
|
||||
|
||||
void Node::SetHeight(float height)
|
||||
void Actor::SetHeight(float height)
|
||||
{
|
||||
this->SetSize(size_.x, height);
|
||||
}
|
||||
|
||||
void Node::SetSize(const Size& size)
|
||||
void Actor::SetSize(const Size& size)
|
||||
{
|
||||
this->SetSize(size.x, size.y);
|
||||
}
|
||||
|
||||
void Node::SetSize(float width, float height)
|
||||
void Actor::SetSize(float width, float height)
|
||||
{
|
||||
if (size_.x == width && size_.y == height)
|
||||
return;
|
||||
|
|
@ -388,19 +388,19 @@ namespace kiwano
|
|||
dirty_transform_ = true;
|
||||
}
|
||||
|
||||
void Node::SetTransform(Transform const& transform)
|
||||
void Actor::SetTransform(Transform const& transform)
|
||||
{
|
||||
transform_ = transform;
|
||||
dirty_transform_ = true;
|
||||
is_fast_transform_ = false;
|
||||
}
|
||||
|
||||
void Node::SetVisible(bool val)
|
||||
void Actor::SetVisible(bool val)
|
||||
{
|
||||
visible_ = val;
|
||||
}
|
||||
|
||||
void Node::SetName(String const& name)
|
||||
void Actor::SetName(String const& name)
|
||||
{
|
||||
if (!IsName(name))
|
||||
{
|
||||
|
|
@ -409,22 +409,22 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::SetPositionX(float x)
|
||||
void Actor::SetPositionX(float x)
|
||||
{
|
||||
this->SetPosition(x, transform_.position.y);
|
||||
}
|
||||
|
||||
void Node::SetPositionY(float y)
|
||||
void Actor::SetPositionY(float y)
|
||||
{
|
||||
this->SetPosition(transform_.position.x, y);
|
||||
}
|
||||
|
||||
void Node::SetPosition(const Point & p)
|
||||
void Actor::SetPosition(const Point & p)
|
||||
{
|
||||
this->SetPosition(p.x, p.y);
|
||||
}
|
||||
|
||||
void Node::SetPosition(float x, float y)
|
||||
void Actor::SetPosition(float x, float y)
|
||||
{
|
||||
if (transform_.position.x == x && transform_.position.y == y)
|
||||
return;
|
||||
|
|
@ -434,32 +434,32 @@ namespace kiwano
|
|||
dirty_transform_ = true;
|
||||
}
|
||||
|
||||
void Node::Move(float x, float y)
|
||||
void Actor::Move(float x, float y)
|
||||
{
|
||||
this->SetPosition(transform_.position.x + x, transform_.position.y + y);
|
||||
}
|
||||
|
||||
void Node::Move(const Point & v)
|
||||
void Actor::Move(const Point & v)
|
||||
{
|
||||
this->Move(v.x, v.y);
|
||||
}
|
||||
|
||||
void Node::SetScaleX(float scale_x)
|
||||
void Actor::SetScaleX(float scale_x)
|
||||
{
|
||||
this->SetScale(scale_x, transform_.scale.y);
|
||||
}
|
||||
|
||||
void Node::SetScaleY(float scale_y)
|
||||
void Actor::SetScaleY(float scale_y)
|
||||
{
|
||||
this->SetScale(transform_.scale.x, scale_y);
|
||||
}
|
||||
|
||||
void Node::SetScale(float scale)
|
||||
void Actor::SetScale(float scale)
|
||||
{
|
||||
this->SetScale(scale, scale);
|
||||
}
|
||||
|
||||
void Node::SetScale(float scale_x, float scale_y)
|
||||
void Actor::SetScale(float scale_x, float scale_y)
|
||||
{
|
||||
if (transform_.scale.x == scale_x && transform_.scale.y == scale_y)
|
||||
return;
|
||||
|
|
@ -470,22 +470,22 @@ namespace kiwano
|
|||
is_fast_transform_ = false;
|
||||
}
|
||||
|
||||
void Node::SetScale(Point const& scale)
|
||||
void Actor::SetScale(Point const& scale)
|
||||
{
|
||||
this->SetScale(scale.x, scale.y);
|
||||
}
|
||||
|
||||
void Node::SetSkewX(float skew_x)
|
||||
void Actor::SetSkewX(float skew_x)
|
||||
{
|
||||
this->SetSkew(skew_x, transform_.skew.y);
|
||||
}
|
||||
|
||||
void Node::SetSkewY(float skew_y)
|
||||
void Actor::SetSkewY(float skew_y)
|
||||
{
|
||||
this->SetSkew(transform_.skew.x, skew_y);
|
||||
}
|
||||
|
||||
void Node::SetSkew(float skew_x, float skew_y)
|
||||
void Actor::SetSkew(float skew_x, float skew_y)
|
||||
{
|
||||
if (transform_.skew.x == skew_x && transform_.skew.y == skew_y)
|
||||
return;
|
||||
|
|
@ -496,12 +496,12 @@ namespace kiwano
|
|||
is_fast_transform_ = false;
|
||||
}
|
||||
|
||||
void Node::SetSkew(Point const& skew)
|
||||
void Actor::SetSkew(Point const& skew)
|
||||
{
|
||||
this->SetSkew(skew.x, skew.y);
|
||||
}
|
||||
|
||||
void Node::SetRotation(float angle)
|
||||
void Actor::SetRotation(float angle)
|
||||
{
|
||||
if (transform_.rotation == angle)
|
||||
return;
|
||||
|
|
@ -511,9 +511,9 @@ namespace kiwano
|
|||
is_fast_transform_ = false;
|
||||
}
|
||||
|
||||
void Node::AddChild(NodePtr child)
|
||||
void Actor::AddChild(ActorPtr child)
|
||||
{
|
||||
KGE_ASSERT(child && "Node::AddChild failed, NULL pointer exception");
|
||||
KGE_ASSERT(child && "Actor::AddChild failed, NULL pointer exception");
|
||||
|
||||
if (child)
|
||||
{
|
||||
|
|
@ -522,7 +522,7 @@ namespace kiwano
|
|||
if (child->parent_)
|
||||
KGE_ERROR_LOG(L"The node to be added already has a parent");
|
||||
|
||||
for (Node* parent = parent_; parent; parent = parent->parent_)
|
||||
for (Actor* parent = parent_; parent; parent = parent->parent_)
|
||||
if (parent == child)
|
||||
KGE_ERROR_LOG(L"A node cannot be its own parent");
|
||||
|
||||
|
|
@ -530,14 +530,14 @@ namespace kiwano
|
|||
|
||||
children_.PushBack(child);
|
||||
child->parent_ = this;
|
||||
child->SetScene(this->scene_);
|
||||
child->SetStage(this->stage_);
|
||||
child->dirty_transform_ = true;
|
||||
child->UpdateOpacity();
|
||||
child->Reorder();
|
||||
}
|
||||
}
|
||||
|
||||
void Node::AddChildren(Array<NodePtr> const& children)
|
||||
void Actor::AddChildren(Array<ActorPtr> const& children)
|
||||
{
|
||||
for (const auto& node : children)
|
||||
{
|
||||
|
|
@ -545,22 +545,22 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
Rect Node::GetBounds() const
|
||||
Rect Actor::GetBounds() const
|
||||
{
|
||||
return Rect(Point{}, size_);
|
||||
}
|
||||
|
||||
Rect Node::GetBoundingBox() const
|
||||
Rect Actor::GetBoundingBox() const
|
||||
{
|
||||
return GetTransformMatrix().Transform(GetBounds());
|
||||
}
|
||||
|
||||
Array<NodePtr> Node::GetChildren(String const& name) const
|
||||
Array<ActorPtr> Actor::GetChildren(String const& name) const
|
||||
{
|
||||
Array<NodePtr> children;
|
||||
Array<ActorPtr> children;
|
||||
size_t hash_code = std::hash<String>{}(name);
|
||||
|
||||
for (Node* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
for (Actor* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
{
|
||||
if (child->hash_name_ == hash_code && child->IsName(name))
|
||||
{
|
||||
|
|
@ -570,11 +570,11 @@ namespace kiwano
|
|||
return children;
|
||||
}
|
||||
|
||||
NodePtr Node::GetChild(String const& name) const
|
||||
ActorPtr Actor::GetChild(String const& name) const
|
||||
{
|
||||
size_t hash_code = std::hash<String>{}(name);
|
||||
|
||||
for (Node* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
for (Actor* child = children_.First().Get(); child; child = child->NextItem().Get())
|
||||
{
|
||||
if (child->hash_name_ == hash_code && child->IsName(name))
|
||||
{
|
||||
|
|
@ -584,12 +584,12 @@ namespace kiwano
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Node::Children const & Node::GetChildren() const
|
||||
Actor::Children const & Actor::GetChildren() const
|
||||
{
|
||||
return children_;
|
||||
}
|
||||
|
||||
void Node::RemoveFromParent()
|
||||
void Actor::RemoveFromParent()
|
||||
{
|
||||
if (parent_)
|
||||
{
|
||||
|
|
@ -597,14 +597,14 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::RemoveChild(NodePtr child)
|
||||
void Actor::RemoveChild(ActorPtr child)
|
||||
{
|
||||
RemoveChild(child.Get());
|
||||
}
|
||||
|
||||
void Node::RemoveChild(Node * child)
|
||||
void Actor::RemoveChild(Actor * child)
|
||||
{
|
||||
KGE_ASSERT(child && "Node::RemoveChild failed, NULL pointer exception");
|
||||
KGE_ASSERT(child && "Actor::RemoveChild failed, NULL pointer exception");
|
||||
|
||||
if (children_.IsEmpty())
|
||||
return;
|
||||
|
|
@ -612,12 +612,12 @@ namespace kiwano
|
|||
if (child)
|
||||
{
|
||||
child->parent_ = nullptr;
|
||||
if (child->scene_) child->SetScene(nullptr);
|
||||
children_.Remove(NodePtr(child));
|
||||
if (child->stage_) child->SetStage(nullptr);
|
||||
children_.Remove(ActorPtr(child));
|
||||
}
|
||||
}
|
||||
|
||||
void Node::RemoveChildren(String const& child_name)
|
||||
void Actor::RemoveChildren(String const& child_name)
|
||||
{
|
||||
if (children_.IsEmpty())
|
||||
{
|
||||
|
|
@ -626,8 +626,8 @@ namespace kiwano
|
|||
|
||||
size_t hash_code = std::hash<String>{}(child_name);
|
||||
|
||||
Node* next;
|
||||
for (Node* child = children_.First().Get(); child; child = next)
|
||||
Actor* next;
|
||||
for (Actor* child = children_.First().Get(); child; child = next)
|
||||
{
|
||||
next = child->NextItem().Get();
|
||||
|
||||
|
|
@ -638,17 +638,17 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Node::RemoveAllChildren()
|
||||
void Actor::RemoveAllChildren()
|
||||
{
|
||||
children_.Clear();
|
||||
}
|
||||
|
||||
void Node::SetResponsible(bool enable)
|
||||
void Actor::SetResponsible(bool enable)
|
||||
{
|
||||
responsible_ = enable;
|
||||
}
|
||||
|
||||
bool Node::ContainsPoint(const Point& point) const
|
||||
bool Actor::ContainsPoint(const Point& point) const
|
||||
{
|
||||
if (size_.x == 0.f || size_.y == 0.f)
|
||||
return false;
|
||||
|
|
@ -27,30 +27,30 @@
|
|||
|
||||
namespace kiwano
|
||||
{
|
||||
class Stage;
|
||||
class Director;
|
||||
|
||||
// 节点
|
||||
class KGE_API Node
|
||||
// 角色
|
||||
class KGE_API Actor
|
||||
: public Object
|
||||
, public TimerManager
|
||||
, public ActionManager
|
||||
, public EventDispatcher
|
||||
, public IntrusiveListItem<NodePtr>
|
||||
, public IntrusiveListItem<ActorPtr>
|
||||
{
|
||||
friend class Stage;
|
||||
friend class Director;
|
||||
friend class Transition;
|
||||
friend class IntrusiveList<NodePtr>;
|
||||
friend class IntrusiveList<ActorPtr>;
|
||||
|
||||
using Children = IntrusiveList<NodePtr>;
|
||||
using Children = IntrusiveList<ActorPtr>;
|
||||
using UpdateCallback = Closure<void(Duration)>;
|
||||
|
||||
public:
|
||||
Node();
|
||||
Actor();
|
||||
|
||||
// 更新节点
|
||||
// 更新角色
|
||||
virtual void OnUpdate(Duration dt) { KGE_UNUSED(dt); }
|
||||
|
||||
// 渲染节点
|
||||
// 渲染角色
|
||||
virtual void OnRender() {}
|
||||
|
||||
// 获取显示状态
|
||||
|
|
@ -87,7 +87,7 @@ namespace kiwano
|
|||
float GetScaleY() const { return transform_.scale.y; }
|
||||
|
||||
// 获取错切角度
|
||||
Point GetSkew() const { return transform_.skew; }
|
||||
Point GetSkew() const { return transform_.skew; }
|
||||
|
||||
// 获取横向错切角度
|
||||
float GetSkewX() const { return transform_.skew.x; }
|
||||
|
|
@ -146,11 +146,11 @@ namespace kiwano
|
|||
// 获取二维变换的逆矩阵
|
||||
Matrix const& GetTransformInverseMatrix() const;
|
||||
|
||||
// 获取父节点
|
||||
inline Node* GetParent() const { return parent_; }
|
||||
// 获取父角色
|
||||
inline Actor* GetParent() const { return parent_; }
|
||||
|
||||
// 获取所在场景
|
||||
inline Scene* GetScene() const { return scene_; }
|
||||
inline Stage* GetStage() const { return stage_; }
|
||||
|
||||
// 设置是否显示
|
||||
void SetVisible(
|
||||
|
|
@ -330,62 +330,62 @@ namespace kiwano
|
|||
bool enable
|
||||
);
|
||||
|
||||
// 判断点是否在节点内
|
||||
// 判断点是否在角色内
|
||||
bool ContainsPoint(
|
||||
const Point& point
|
||||
) const;
|
||||
|
||||
// 添加子节点
|
||||
// 添加子角色
|
||||
void AddChild(
|
||||
NodePtr child
|
||||
ActorPtr child
|
||||
);
|
||||
|
||||
// 添加多个子节点
|
||||
// 添加多个子角色
|
||||
void AddChildren(
|
||||
Array<NodePtr> const& children
|
||||
Array<ActorPtr> const& children
|
||||
);
|
||||
|
||||
// 获取所有名称相同的子节点
|
||||
Array<NodePtr> GetChildren(
|
||||
// 获取所有名称相同的子角色
|
||||
Array<ActorPtr> GetChildren(
|
||||
String const& name
|
||||
) const;
|
||||
|
||||
// 获取名称相同的子节点
|
||||
NodePtr GetChild(
|
||||
// 获取名称相同的子角色
|
||||
ActorPtr GetChild(
|
||||
String const& name
|
||||
) const;
|
||||
|
||||
// 获取全部子节点
|
||||
// 获取全部子角色
|
||||
Children const& GetChildren() const;
|
||||
|
||||
// 移除子节点
|
||||
// 移除子角色
|
||||
void RemoveChild(
|
||||
NodePtr child
|
||||
ActorPtr child
|
||||
);
|
||||
|
||||
// 移除子节点
|
||||
// 移除子角色
|
||||
void RemoveChild(
|
||||
Node* child
|
||||
Actor* child
|
||||
);
|
||||
|
||||
// 移除所有名称相同的子节点
|
||||
// 移除所有名称相同的子角色
|
||||
void RemoveChildren(
|
||||
String const& child_name
|
||||
);
|
||||
|
||||
// 移除所有节点
|
||||
// 移除所有角色
|
||||
void RemoveAllChildren();
|
||||
|
||||
// 从父节点移除
|
||||
// 从父角色移除
|
||||
void RemoveFromParent();
|
||||
|
||||
// 暂停节点更新
|
||||
// 暂停角色更新
|
||||
inline void PauseUpdating() { update_pausing_ = true; }
|
||||
|
||||
// 继续节点更新
|
||||
// 继续角色更新
|
||||
inline void ResumeUpdating() { update_pausing_ = false; }
|
||||
|
||||
// 节点更新是否暂停
|
||||
// 角色更新是否暂停
|
||||
inline bool IsUpdatePausing() const { return update_pausing_; }
|
||||
|
||||
// 设置更新时的回调函数
|
||||
|
|
@ -394,7 +394,7 @@ namespace kiwano
|
|||
// 获取更新时的回调函数
|
||||
inline UpdateCallback GetCallbackOnUpdate() const { return cb_update_; }
|
||||
|
||||
// 渲染节点边界
|
||||
// 渲染角色边界
|
||||
inline void ShowBorder(bool show) { show_border_ = show; }
|
||||
|
||||
// 设置默认锚点
|
||||
|
|
@ -422,7 +422,7 @@ namespace kiwano
|
|||
|
||||
void Reorder();
|
||||
|
||||
void SetScene(Scene* scene);
|
||||
void SetStage(Stage* scene);
|
||||
|
||||
protected:
|
||||
bool visible_;
|
||||
|
|
@ -435,8 +435,8 @@ namespace kiwano
|
|||
int z_order_;
|
||||
float opacity_;
|
||||
float displayed_opacity_;
|
||||
Node* parent_;
|
||||
Scene* scene_;
|
||||
Actor* parent_;
|
||||
Stage* stage_;
|
||||
size_t hash_name_;
|
||||
Point anchor_;
|
||||
Size size_;
|
||||
|
|
@ -452,9 +452,9 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 可视化节点
|
||||
// 可视化角色
|
||||
class KGE_API VisualNode
|
||||
: public Node
|
||||
: public Actor
|
||||
{
|
||||
public:
|
||||
virtual void PrepareRender() override;
|
||||
|
|
@ -51,7 +51,7 @@ namespace kiwano
|
|||
frames_ = frames;
|
||||
}
|
||||
|
||||
void Animation::Init(NodePtr target)
|
||||
void Animation::Init(ActorPtr target)
|
||||
{
|
||||
if (!frames_ || frames_->GetFrames().empty())
|
||||
{
|
||||
|
|
@ -66,7 +66,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Animation::UpdateTween(NodePtr target, float percent)
|
||||
void Animation::UpdateTween(ActorPtr target, float percent)
|
||||
{
|
||||
auto sprite_target = dynamic_cast<Sprite*>(target.Get());
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ namespace kiwano
|
|||
ActionPtr Reverse() const override;
|
||||
|
||||
protected:
|
||||
void Init(NodePtr target) override;
|
||||
void Init(ActorPtr target) override;
|
||||
|
||||
void UpdateTween(NodePtr target, float percent) override;
|
||||
void UpdateTween(ActorPtr target, float percent) override;
|
||||
|
||||
protected:
|
||||
FramesPtr frames_;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "Font.hpp"
|
||||
#include "TextStyle.hpp"
|
||||
#include "../renderer/TextRenderer.h"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "../base/Resource.h"
|
||||
#include "../renderer/render.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace kiwano
|
|||
|
||||
if (!swallow_)
|
||||
{
|
||||
NodePtr prev;
|
||||
ActorPtr prev;
|
||||
for (auto child = children_.Last(); child; child = prev)
|
||||
{
|
||||
prev = child->PrevItem();
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
class KGE_API Layer
|
||||
: public Node
|
||||
: public Actor
|
||||
{
|
||||
public:
|
||||
Layer();
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "../renderer/render.h" // ID2D1Geometry
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
// 二维图形节点
|
||||
// śţÎŹÍźĐνÇÉŤ
|
||||
class KGE_API ShapeNode
|
||||
: public VisualNode
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 矩形节点
|
||||
// žŘĐνÇÉŤ
|
||||
class KGE_API RectNode
|
||||
: public ShapeNode
|
||||
{
|
||||
|
|
@ -171,7 +171,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 圆角矩形节点
|
||||
// Ô˛˝ÇžŘĐνÇÉŤ
|
||||
class KGE_API RoundedRectNode
|
||||
: public ShapeNode
|
||||
{
|
||||
|
|
@ -214,7 +214,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 圆形节点
|
||||
// Ô˛ĐνÇÉŤ
|
||||
class KGE_API CircleNode
|
||||
: public ShapeNode
|
||||
{
|
||||
|
|
@ -251,7 +251,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 椭圆节点
|
||||
// ÍÖÔ˛˝ÇÉŤ
|
||||
class KGE_API EllipseNode
|
||||
: public ShapeNode
|
||||
{
|
||||
|
|
@ -294,7 +294,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
|
||||
// 路径节点
|
||||
// ¡žś˝ÇÉŤ
|
||||
class KGE_API PathNode
|
||||
: public ShapeNode
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace kiwano
|
|||
{
|
||||
image_ = image;
|
||||
|
||||
Node::SetSize(image_->GetWidth(), image_->GetHeight());
|
||||
Actor::SetSize(image_->GetWidth(), image_->GetHeight());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -76,7 +76,7 @@ namespace kiwano
|
|||
void Sprite::Crop(const Rect& crop_rect)
|
||||
{
|
||||
image_->Crop(crop_rect);
|
||||
Node::SetSize(
|
||||
Actor::SetSize(
|
||||
std::min(std::max(crop_rect.size.x, 0.f), image_->GetSourceWidth() - image_->GetCropX()),
|
||||
std::min(std::max(crop_rect.size.y, 0.f), image_->GetSourceHeight() - image_->GetCropY())
|
||||
);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "Image.h"
|
||||
|
||||
namespace kiwano
|
||||
|
|
|
|||
|
|
@ -18,32 +18,32 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Scene.h"
|
||||
#include "Stage.h"
|
||||
#include "../base/logs.h"
|
||||
#include "../renderer/render.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
Scene::Scene()
|
||||
Stage::Stage()
|
||||
{
|
||||
scene_ = this;
|
||||
stage_ = this;
|
||||
|
||||
SetAnchor(0, 0);
|
||||
SetSize(Renderer::Instance()->GetOutputSize());
|
||||
}
|
||||
|
||||
Scene::~Scene()
|
||||
Stage::~Stage()
|
||||
{
|
||||
}
|
||||
|
||||
void Scene::OnEnter()
|
||||
void Stage::OnEnter()
|
||||
{
|
||||
KGE_LOG(L"Scene entered");
|
||||
KGE_LOG(L"Stage entered");
|
||||
}
|
||||
|
||||
void Scene::OnExit()
|
||||
void Stage::OnExit()
|
||||
{
|
||||
KGE_LOG(L"Scene exited");
|
||||
KGE_LOG(L"Stage exited");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -19,21 +19,21 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
// ³¡¾°
|
||||
class KGE_API Scene
|
||||
: public Node
|
||||
class KGE_API Stage
|
||||
: public Actor
|
||||
{
|
||||
friend class Transition;
|
||||
friend class Stage;
|
||||
friend class Director;
|
||||
|
||||
public:
|
||||
Scene();
|
||||
Stage();
|
||||
|
||||
virtual ~Scene();
|
||||
virtual ~Stage();
|
||||
|
||||
// ½øÈ볡¾°
|
||||
virtual void OnEnter();
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#pragma once
|
||||
#include "Node.h"
|
||||
#include "Actor.h"
|
||||
#include "Font.hpp"
|
||||
#include "TextStyle.hpp"
|
||||
#include <dwrite.h>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#include "Transition.h"
|
||||
#include "Node.h"
|
||||
#include "Scene.h"
|
||||
#include "Actor.h"
|
||||
#include "Stage.h"
|
||||
#include "../base/window.h"
|
||||
#include "../base/logs.h"
|
||||
#include "../renderer/render.h"
|
||||
|
|
@ -55,7 +55,7 @@ namespace kiwano
|
|||
return done_;
|
||||
}
|
||||
|
||||
void Transition::Init(ScenePtr prev, ScenePtr next)
|
||||
void Transition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
process_ = 0;
|
||||
delta_ = Duration{};
|
||||
|
|
@ -147,7 +147,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void BoxTransition::Init(ScenePtr prev, ScenePtr next)
|
||||
void BoxTransition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
Transition::Init(prev, next);
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void EmergeTransition::Init(ScenePtr prev, ScenePtr next)
|
||||
void EmergeTransition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
Transition::Init(prev, next);
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void FadeTransition::Init(ScenePtr prev, ScenePtr next)
|
||||
void FadeTransition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
Transition::Init(prev, next);
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void MoveTransition::Init(ScenePtr prev, ScenePtr next)
|
||||
void MoveTransition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
Transition::Init(prev, next);
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ namespace kiwano
|
|||
{
|
||||
}
|
||||
|
||||
void RotationTransition::Init(ScenePtr prev, ScenePtr next)
|
||||
void RotationTransition::Init(StagePtr prev, StagePtr next)
|
||||
{
|
||||
Transition::Init(prev, next);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@
|
|||
|
||||
namespace kiwano
|
||||
{
|
||||
class Stage;
|
||||
class Director;
|
||||
|
||||
// ³¡¾°¹ý¶É
|
||||
class KGE_API Transition
|
||||
: public Object
|
||||
{
|
||||
friend class Stage;
|
||||
friend class Director;
|
||||
|
||||
public:
|
||||
explicit Transition(
|
||||
|
|
@ -43,8 +43,8 @@ namespace kiwano
|
|||
|
||||
protected:
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
);
|
||||
|
||||
virtual void Update(Duration dt);
|
||||
|
|
@ -61,8 +61,8 @@ namespace kiwano
|
|||
Duration duration_;
|
||||
Duration delta_;
|
||||
Size window_size_;
|
||||
ScenePtr out_scene_;
|
||||
ScenePtr in_scene_;
|
||||
StagePtr out_scene_;
|
||||
StagePtr in_scene_;
|
||||
ComPtr<ID2D1Layer> out_layer_;
|
||||
ComPtr<ID2D1Layer> in_layer_;
|
||||
LayerProperties out_layer_prop_;
|
||||
|
|
@ -84,8 +84,8 @@ namespace kiwano
|
|||
void Update(Duration dt) override;
|
||||
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
) override;
|
||||
};
|
||||
|
||||
|
|
@ -103,8 +103,8 @@ namespace kiwano
|
|||
void Update(Duration dt) override;
|
||||
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
) override;
|
||||
};
|
||||
|
||||
|
|
@ -122,8 +122,8 @@ namespace kiwano
|
|||
void Update(Duration dt) override;
|
||||
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
) override;
|
||||
};
|
||||
|
||||
|
|
@ -142,8 +142,8 @@ namespace kiwano
|
|||
void Update(Duration dt) override;
|
||||
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
) override;
|
||||
|
||||
void Reset() override;
|
||||
|
|
@ -169,8 +169,8 @@ namespace kiwano
|
|||
void Update(Duration dt) override;
|
||||
|
||||
virtual void Init(
|
||||
ScenePtr prev,
|
||||
ScenePtr next
|
||||
StagePtr prev,
|
||||
StagePtr next
|
||||
) override;
|
||||
|
||||
void Reset() override;
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ namespace kiwano
|
|||
KGE_DECLARE_SMART_PTR(GifImage);
|
||||
KGE_DECLARE_SMART_PTR(Frames);
|
||||
|
||||
KGE_DECLARE_SMART_PTR(Node);
|
||||
KGE_DECLARE_SMART_PTR(Scene);
|
||||
KGE_DECLARE_SMART_PTR(Actor);
|
||||
KGE_DECLARE_SMART_PTR(Stage);
|
||||
KGE_DECLARE_SMART_PTR(Layer);
|
||||
KGE_DECLARE_SMART_PTR(Sprite);
|
||||
KGE_DECLARE_SMART_PTR(GifSprite);
|
||||
|
|
|
|||
|
|
@ -18,26 +18,26 @@
|
|||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Stage.h"
|
||||
#include "../2d/Node.h"
|
||||
#include "../2d/Scene.h"
|
||||
#include "Director.h"
|
||||
#include "../2d/Actor.h"
|
||||
#include "../2d/Stage.h"
|
||||
#include "../2d/Transition.h"
|
||||
#include "../2d/DebugNode.h"
|
||||
|
||||
namespace kiwano
|
||||
{
|
||||
Stage::Stage()
|
||||
Director::Director()
|
||||
: render_border_enabled_(false)
|
||||
{
|
||||
}
|
||||
|
||||
Stage::~Stage()
|
||||
Director::~Director()
|
||||
{
|
||||
}
|
||||
|
||||
void Stage::EnterScene(ScenePtr scene)
|
||||
void Director::EnterStage(StagePtr scene)
|
||||
{
|
||||
KGE_ASSERT(scene && "Stage::EnterScene failed, NULL pointer exception");
|
||||
KGE_ASSERT(scene && "Director::EnterStage failed, NULL pointer exception");
|
||||
|
||||
if (curr_scene_ == scene || next_scene_ == scene)
|
||||
return;
|
||||
|
|
@ -45,9 +45,9 @@ namespace kiwano
|
|||
next_scene_ = scene;
|
||||
}
|
||||
|
||||
void Stage::EnterScene(ScenePtr scene, TransitionPtr transition)
|
||||
void Director::EnterStage(StagePtr scene, TransitionPtr transition)
|
||||
{
|
||||
EnterScene(scene);
|
||||
EnterStage(scene);
|
||||
|
||||
if (transition && next_scene_)
|
||||
{
|
||||
|
|
@ -60,17 +60,17 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
ScenePtr Stage::GetCurrentScene()
|
||||
StagePtr Director::GetCurrentStage()
|
||||
{
|
||||
return curr_scene_;
|
||||
}
|
||||
|
||||
void Stage::SetRenderBorderEnabled(bool enabled)
|
||||
void Director::SetRenderBorderEnabled(bool enabled)
|
||||
{
|
||||
render_border_enabled_ = enabled;
|
||||
}
|
||||
|
||||
void Stage::ShowDebugInfo(bool show)
|
||||
void Director::ShowDebugInfo(bool show)
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
|
|
@ -83,7 +83,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Stage::OnUpdate(Duration dt)
|
||||
void Director::OnUpdate(Duration dt)
|
||||
{
|
||||
if (transition_)
|
||||
{
|
||||
|
|
@ -116,7 +116,7 @@ namespace kiwano
|
|||
debug_node_->Update(dt);
|
||||
}
|
||||
|
||||
void Stage::OnRender()
|
||||
void Director::OnRender()
|
||||
{
|
||||
if (transition_)
|
||||
{
|
||||
|
|
@ -131,7 +131,7 @@ namespace kiwano
|
|||
debug_node_->Render();
|
||||
}
|
||||
|
||||
void Stage::AfterRender()
|
||||
void Director::AfterRender()
|
||||
{
|
||||
if (render_border_enabled_)
|
||||
{
|
||||
|
|
@ -140,7 +140,7 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
void Stage::HandleEvent(Event& evt)
|
||||
void Director::HandleEvent(Event& evt)
|
||||
{
|
||||
if (debug_node_)
|
||||
debug_node_->Dispatch(evt);
|
||||
|
|
@ -26,28 +26,28 @@
|
|||
|
||||
namespace kiwano
|
||||
{
|
||||
class KGE_API Stage
|
||||
: public Singleton<Stage>
|
||||
class KGE_API Director
|
||||
: public Singleton<Director>
|
||||
, public Component
|
||||
{
|
||||
KGE_DECLARE_SINGLETON(Stage);
|
||||
KGE_DECLARE_SINGLETON(Director);
|
||||
|
||||
public:
|
||||
// 切换场景
|
||||
void EnterScene(
|
||||
ScenePtr scene /* 场景 */
|
||||
void EnterStage(
|
||||
StagePtr scene /* 场景 */
|
||||
);
|
||||
|
||||
// 切换场景
|
||||
void EnterScene(
|
||||
ScenePtr scene, /* 场景 */
|
||||
void EnterStage(
|
||||
StagePtr scene, /* 场景 */
|
||||
TransitionPtr transition /* 场景动画 */
|
||||
);
|
||||
|
||||
// 获取当前场景
|
||||
ScenePtr GetCurrentScene();
|
||||
StagePtr GetCurrentStage();
|
||||
|
||||
// 启用或禁用场景内的节点边界渲染功能
|
||||
// 启用或禁用角色边界渲染功能
|
||||
void SetRenderBorderEnabled(bool enabled);
|
||||
|
||||
// 显示调试信息
|
||||
|
|
@ -67,15 +67,15 @@ namespace kiwano
|
|||
void HandleEvent(Event& evt) override;
|
||||
|
||||
protected:
|
||||
Stage();
|
||||
Director();
|
||||
|
||||
virtual ~Stage();
|
||||
virtual ~Director();
|
||||
|
||||
protected:
|
||||
bool render_border_enabled_;
|
||||
ScenePtr curr_scene_;
|
||||
ScenePtr next_scene_;
|
||||
NodePtr debug_node_;
|
||||
StagePtr curr_scene_;
|
||||
StagePtr next_scene_;
|
||||
ActorPtr debug_node_;
|
||||
TransitionPtr transition_;
|
||||
};
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ namespace kiwano
|
|||
void* data;
|
||||
};
|
||||
|
||||
class Node;
|
||||
class Actor;
|
||||
|
||||
// 事件
|
||||
struct KGE_API Event
|
||||
|
|
@ -145,7 +145,7 @@ namespace kiwano
|
|||
};
|
||||
|
||||
UINT type;
|
||||
Node* target;
|
||||
Actor* target;
|
||||
|
||||
union
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
#include "base/time.h"
|
||||
#include "base/window.h"
|
||||
#include "base/input.h"
|
||||
#include "base/Stage.h"
|
||||
#include "base/Director.h"
|
||||
#include "base/logs.h"
|
||||
#include "renderer/render.h"
|
||||
#include "platform/modules.h"
|
||||
|
|
@ -94,8 +94,8 @@
|
|||
#include "2d/ActionManager.h"
|
||||
#include "2d/Transition.h"
|
||||
|
||||
#include "2d/Node.h"
|
||||
#include "2d/Scene.h"
|
||||
#include "2d/Actor.h"
|
||||
#include "2d/Stage.h"
|
||||
#include "2d/Layer.h"
|
||||
#include "2d/Sprite.h"
|
||||
#include "2d/GifSprite.h"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "../base/window.h"
|
||||
#include "../base/logs.h"
|
||||
#include "../base/input.h"
|
||||
#include "../base/Stage.h"
|
||||
#include "../base/Director.h"
|
||||
#include "../renderer/render.h"
|
||||
#include <windowsx.h> // GET_X_LPARAM, GET_Y_LPARAM
|
||||
#include <imm.h> // ImmAssociateContext
|
||||
|
|
@ -66,7 +66,7 @@ namespace kiwano
|
|||
|
||||
Use(Renderer::Instance());
|
||||
Use(Input::Instance());
|
||||
Use(Stage::Instance());
|
||||
Use(Director::Instance());
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
|
|
@ -100,7 +100,7 @@ namespace kiwano
|
|||
|
||||
if (options.debug)
|
||||
{
|
||||
Stage::Instance()->ShowDebugInfo(true);
|
||||
Director::Instance()->ShowDebugInfo(true);
|
||||
Renderer::Instance()->SetCollectingStatus(true);
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ namespace kiwano
|
|||
}
|
||||
|
||||
// Destroy all instances
|
||||
Stage::Destroy();
|
||||
Director::Destroy();
|
||||
Input::Destroy();
|
||||
Renderer::Destroy();
|
||||
Window::Destroy();
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
// THE SOFTWARE.
|
||||
|
||||
#include "Button.h"
|
||||
#include "../2d/Scene.h"
|
||||
#include "../2d/Stage.h"
|
||||
#include "../base/window.h"
|
||||
|
||||
namespace kiwano
|
||||
|
|
@ -145,4 +145,4 @@ namespace kiwano
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace kiwano
|
|||
{
|
||||
// 꽉데
|
||||
class KGE_API Menu
|
||||
: public Node
|
||||
: public Actor
|
||||
{
|
||||
public:
|
||||
Menu();
|
||||
|
|
|
|||
Loading…
Reference in New Issue