Kiwano Engine v1.3.x
kiwano::DebugActor类 参考

调试节点 更多...

#include <DebugActor.h>

类 kiwano::DebugActor 继承关系图:
kiwano::Actor kiwano::ObjectBase kiwano::Animator kiwano::TaskScheduler kiwano::EventDispatcher kiwano::ComponentManager kiwano::IntrusiveListValue< RefPtr< Actor > > kiwano::RefObject kiwano::Serializable kiwano::Noncopyable kiwano::Noncopyable

Public 成员函数

void OnRender (RenderContext &ctx) override
 渲染角色 更多...
 
void OnUpdate (Duration dt) override
 更新角色 更多...
 
- Public 成员函数 继承自 kiwano::Actor
virtual void OnUpdate (Duration dt)
 更新角色 更多...
 
virtual void OnRender (RenderContext &ctx)
 渲染角色 更多...
 
bool IsVisible () const
 获取显示状态
 
bool IsCascadeOpacityEnabled () const
 是否启用级联透明度
 
bool IsEventDispatchEnabled () const
 是否启用事件分发
 
size_t GetHashName () const
 获取名称的 Hash 值
 
int GetZOrder () const
 获取 Z 轴顺序
 
virtual Point GetPosition () const
 获取坐标
 
float GetPositionX () const
 获取 x 坐标
 
float GetPositionY () const
 获取 y 坐标
 
virtual Size GetSize () const
 获取大小 更多...
 
float GetWidth () const
 获取宽度
 
float GetHeight () const
 获取高度
 
float GetScaledWidth () const
 获取缩放后的宽度
 
float GetScaledHeight () const
 获取缩放后的高度
 
Size GetScaledSize () const
 获取缩放后的大小
 
virtual Point GetAnchor () const
 获取锚点
 
float GetAnchorX () const
 获取 x 方向锚点
 
float GetAnchorY () const
 获取 y 方向锚点
 
virtual float GetOpacity () const
 获取透明度
 
float GetDisplayedOpacity () const
 获取显示透明度
 
virtual float GetRotation () const
 获取旋转角度
 
virtual Point GetScale () const
 获取缩放比例
 
float GetScaleX () const
 获取横向缩放比例
 
float GetScaleY () const
 获取纵向缩放比例
 
virtual Point GetSkew () const
 获取错切角度
 
float GetSkewX () const
 获取横向错切角度
 
float GetSkewY () const
 获取纵向错切角度
 
Transform GetTransform () const
 获取变换
 
ActorGetParent () const
 获取父角色
 
StageGetStage () const
 获取所在舞台
 
virtual Rect GetBounds () const
 获取边框 更多...
 
virtual Rect GetBoundingBox () const
 获取外切包围盒 更多...
 
const Matrix3x2GetTransformMatrix () const
 获取二维变换矩阵
 
const Matrix3x2GetTransformInverseMatrix () const
 获取二维变换的逆矩阵
 
const Matrix3x2GetTransformMatrixToParent () const
 获取变换到父角色的二维变换矩阵
 
void SetVisible (bool val)
 设置角色是否可见
 
void SetName (StringView name)
 设置名称
 
virtual void SetPosition (const Point &point)
 设置坐标
 
void SetPosition (float x, float y)
 设置坐标
 
void SetPositionX (float x)
 设置横坐标
 
void SetPositionY (float y)
 设置纵坐标
 
void MoveTo (const Point &p)
 移动至坐标
 
void MoveTo (float x, float y)
 移动至坐标
 
void MoveBy (const Vec2 &trans)
 移动相对坐标
 
void MoveBy (float trans_x, float trans_y)
 移动相对坐标
 
virtual void SetScale (const Vec2 &scale)
 设置缩放比例,默认为 (1.0, 1.0)
 
void SetScale (float scalex, float scaley)
 设置缩放比例,默认为 (1.0, 1.0)
 
virtual void SetSkew (const Vec2 &skew)
 设置错切角度,默认为 (0, 0)
 
void SetSkew (float skewx, float skewy)
 设置错切角度,默认为 (0, 0)
 
virtual void SetRotation (float rotation)
 设置旋转角度,默认为 0
 
virtual void SetAnchor (const Vec2 &anchor)
 设置锚点位置,默认为 (0, 0), 范围 [0, 1]
 
void SetAnchor (float anchorx, float anchory)
 设置锚点位置,默认为 (0, 0), 范围 [0, 1]
 
virtual void SetSize (const Size &size)
 修改大小
 
void SetSize (float width, float height)
 修改大小
 
void SetWidth (float width)
 修改宽度
 
void SetHeight (float height)
 修改高度
 
virtual void SetOpacity (float opacity)
 设置透明度,默认为 1.0, 范围 [0, 1] 更多...
 
void SetCascadeOpacityEnabled (bool enabled)
 启用或禁用级联透明度
 
void SetTransform (const Transform &transform)
 设置二维仿射变换
 
void SetZOrder (int zorder)
 设置 Z 轴顺序,默认为 0
 
void AddChild (RefPtr< Actor > child)
 添加子角色
 
void AddChild (RefPtr< Actor > child, int zorder)
 添加子角色
 
void AddChildren (const Vector< RefPtr< Actor > > &children)
 添加多个子角色
 
RefPtr< ActorGetChild (StringView name) const
 获取名称相同的子角色
 
Vector< RefPtr< Actor > > GetChildren (StringView name) const
 获取所有名称相同的子角色
 
ActorListGetAllChildren ()
 获取全部子角色
 
const ActorListGetAllChildren () const
 获取全部子角色
 
void RemoveChild (RefPtr< Actor > child)
 移除子角色
 
void RemoveChildren (StringView child_name)
 移除所有名称相同的子角色
 
void RemoveAllChildren ()
 移除所有角色
 
void RemoveFromParent ()
 从父角色移除
 
void PauseUpdating ()
 暂停角色更新
 
void ResumeUpdating ()
 继续角色更新
 
bool IsUpdatePausing () const
 角色更新是否暂停
 
void SetCallbackOnUpdate (const UpdateCallback &cb)
 设置更新时的回调函数
 
UpdateCallback GetCallbackOnUpdate () const
 获取更新时的回调函数
 
virtual bool ContainsPoint (const Point &point) const
 判断点是否在角色内 更多...
 
Point ConvertToLocal (const Point &point) const
 将世界坐标系点转换为局部坐标系点
 
Point ConvertToWorld (const Point &point) const
 将局部坐标系点转换为世界坐标系点
 
void ShowBorder (bool show)
 渲染角色边界
 
virtual bool DispatchEvent (Event *evt)
 分发事件 更多...
 
bool HandleEvent (Event *evt)
 处理事件且不分发 更多...
 
void SetEventDispatchEnabled (bool enabled)
 开启或关闭事件分发功能 更多...
 
void DoSerialize (Serializer *serializer) const override
 序列化 更多...
 
void DoDeserialize (Deserializer *deserializer) override
 反序列化 更多...
 
- Public 成员函数 继承自 kiwano::ObjectBase
 ObjectBase ()
 构造基础对象
 
void SetName (StringView name)
 设置对象名
 
StringView GetName () const
 获取对象名
 
bool IsName (StringView name) const
 判断对象的名称是否相同 更多...
 
void * GetUserData () const
 获取用户数据
 
void SetUserData (void *data)
 设置用户数据 更多...
 
void Hold (RefPtr< ObjectBase > other)
 持有一个对象并管理其生命周期 更多...
 
void Unhold (RefPtr< ObjectBase > other)
 放弃持有的对象 更多...
 
uint64_t GetObjectID () const
 获取对象ID
 
void DoSerialize (Serializer *serializer) const override
 序列化 更多...
 
void DoDeserialize (Deserializer *deserializer) override
 反序列化 更多...
 
virtual bool IsValid () const
 判断对象是否有效 更多...
 
ObjectStatusGetStatus () const
 获取对象状态
 
void SetStatus (const ObjectStatus &status)
 设置对象状态
 
void Fail (StringView msg, int code=ObjectStatus::fail)
 将对象标记为失败状态
 
void ClearStatus ()
 清除对象状态
 
- Public 成员函数 继承自 kiwano::RefObject
void Retain ()
 增加引用计数
 
void Release ()
 减少引用计数
 
uint32_t GetRefCount () const
 获取引用计数
 
- Public 成员函数 继承自 kiwano::Serializable
Vector< uint8_t > Serialize () const
 序列化为字节串
 
void Deserialize (const Vector< uint8_t > &data)
 从字节串反序列化
 
virtual void DoSerialize (Serializer *serializer) const =0
 执行序列化 更多...
 
virtual void DoDeserialize (Deserializer *deserializer)=0
 执行反序列化 更多...
 
- Public 成员函数 继承自 kiwano::Animator
AnimationAddAnimation (RefPtr< Animation > animation)
 添加动画
 
AnimationStartAnimation (RefPtr< Animation > animation)
 开始动画
 
void ResumeAllAnimations ()
 继续所有暂停动画
 
void PauseAllAnimations ()
 暂停所有动画
 
void StopAllAnimations ()
 停止所有动画
 
AnimationGetAnimation (StringView name)
 获取指定名称的动画 更多...
 
const AnimationListGetAllAnimations () const
 获取所有动画
 
void Update (Actor *target, Duration dt)
 更新动画
 
- Public 成员函数 继承自 kiwano::TaskScheduler
TaskAddTask (RefPtr< Task > task)
 添加任务
 
TaskAddTask (const Task::Callback &cb, RefPtr< Ticker > ticker)
 添加任务 更多...
 
TaskAddTask (StringView name, const Task::Callback &cb, RefPtr< Ticker > ticker)
 添加任务 更多...
 
TaskAddTask (const Task::Callback &cb, Duration interval, int times=-1)
 添加任务 更多...
 
TaskAddTask (StringView name, const Task::Callback &cb, Duration interval, int times=-1)
 添加任务 更多...
 
void StartTasks (StringView task_name)
 启动任务
 
void StopTasks (StringView task_name)
 停止任务
 
void RemoveTasks (StringView task_name)
 移除任务
 
void StartAllTasks ()
 启动所有任务
 
void StopAllTasks ()
 停止所有任务
 
void RemoveAllTasks ()
 移除所有任务
 
const TaskListGetAllTasks () const
 获取所有任务
 
void Update (Duration dt)
 更新调度器
 
- Public 成员函数 继承自 kiwano::EventDispatcher
EventListenerAddListener (RefPtr< EventListener > listener)
 添加监听器
 
EventListenerAddListener (EventType type, EventListener::Callback callback)
 添加监听器 更多...
 
EventListenerAddListener (StringView name, EventType type, EventListener::Callback callback)
 添加监听器 更多...
 
template<typename _EventTy >
EventListenerAddListener (EventListener::Callback callback)
 添加监听器 更多...
 
template<typename _EventTy >
EventListenerAddListener (StringView name, EventListener::Callback callback)
 添加监听器 更多...
 
void StartListeners (StringView name)
 启动监听器 更多...
 
void StopListeners (StringView name)
 停止监听器 更多...
 
void RemoveListeners (StringView name)
 移除监听器 更多...
 
void StartAllListeners ()
 启动所有监听器
 
void StopAllListeners ()
 停止所有监听器
 
void RemoveAllListeners ()
 移除所有监听器
 
const ListenerListGetAllListeners () const
 获取所有监听器
 
bool DispatchEvent (Event *evt)
 分发事件 更多...
 
- Public 成员函数 继承自 kiwano::ComponentManager
ComponentAddComponent (RefPtr< Component > component)
 添加组件 更多...
 
ComponentAddComponent (size_t index, RefPtr< Component > component)
 添加组件 更多...
 
ComponentGetComponent (StringView name)
 获取组件
 
ComponentGetComponent (size_t name_hash)
 获取组件
 
ComponentMapGetAllComponents ()
 获取所有组件
 
const ComponentMapGetAllComponents () const
 获取所有组件
 
void RemoveComponent (RefPtr< Component > component)
 移除组件
 
void RemoveComponent (StringView name)
 移除组件 更多...
 
void RemoveComponent (size_t name_hash)
 移除组件 更多...
 
void RemoveAllComponents ()
 移除所有组件
 
void Update (Duration dt)
 更新组件
 
void Render (RenderContext &ctx)
 渲染组件
 
void DispatchToComponents (Event *evt)
 分发事件
 

Protected 成员函数

bool CheckVisibility (RenderContext &ctx) const override
 检查是否在渲染上下文的视区内 更多...
 
- Protected 成员函数 继承自 kiwano::Actor
virtual void Update (Duration dt)
 更新自身和所有子角色 更多...
 
virtual void Render (RenderContext &ctx)
 渲染自身和所有子角色 更多...
 
virtual void RenderBorder (RenderContext &ctx)
 绘制自身和所有子角色的边界 更多...
 
virtual bool CheckVisibility (RenderContext &ctx) const
 检查是否在渲染上下文的视区内 更多...
 
virtual void PrepareToRender (RenderContext &ctx)
 渲染前初始化渲染上下文状态,仅当 CheckVisibility 返回真时调用该函数
 
void UpdateTransform () const
 更新自己的二维变换,并通知所有子角色
 
void UpdateTransformUpwards () const
 向上追溯更新 更多...
 
void UpdateOpacity ()
 更新自己和所有子角色的透明度
 
void Reorder ()
 将所有子角色按Z轴顺序排序
 
void SetStage (Stage *stage)
 设置节点所在舞台
 
- Protected 成员函数 继承自 kiwano::ComponentManager
 ComponentManager (Actor *target)
 
- Protected 成员函数 继承自 kiwano::IntrusiveListValue< RefPtr< Actor > >
 IntrusiveListValue (value_type rhs)
 
const value_type & GetPrev () const
 获取前一元素
 
value_type & GetPrev ()
 获取前一元素
 
const value_type & GetNext () const
 获取下一元素
 
value_type & GetNext ()
 获取下一元素
 

额外继承的成员函数

- Public 类型 继承自 kiwano::Actor
typedef Function< void(Duration)> UpdateCallback
 角色更新回调函数
 
- 静态 Public 成员函数 继承自 kiwano::Actor
static void SetDefaultAnchor (float anchor_x, float anchor_y)
 设置默认锚点
 
- 静态 Public 成员函数 继承自 kiwano::ObjectBase
static void SetObjectPolicy (const ObjectPolicyFunc &policy)
 设置对象处理策略
 
static bool IsTracingLeaks ()
 是否启用了内存泄漏追踪
 
static void StartTracingLeaks ()
 开始追踪内存泄漏
 
static void StopTracingLeaks ()
 停止追踪内存泄漏
 
static void DumpTracingObjects ()
 打印所有追踪中的对象信息
 
static Vector< ObjectBase * > & GetTracingObjects ()
 获取所有追踪中的对象
 
- 静态 Public 成员函数 继承自 kiwano::RefObject
static void * operator new (size_t size)
 
static void operator delete (void *ptr)
 
static void * operator new (size_t size, std::nothrow_t const &) noexcept
 
static void operator delete (void *ptr, std::nothrow_t const &) noexcept
 
static void * operator new (size_t size, void *ptr) noexcept
 
static void operator delete (void *ptr, void *place) noexcept
 
- Protected 类型 继承自 kiwano::IntrusiveListValue< RefPtr< Actor > >
using value_type = typename std::pointer_traits< RefPtr< Actor > >::pointer
 
using reference = value_type &
 
using pointer = value_type *
 

详细描述

调试节点

成员函数说明

◆ CheckVisibility()

bool kiwano::DebugActor::CheckVisibility ( RenderContext ctx) const
overrideprotectedvirtual

检查是否在渲染上下文的视区内

重载 kiwano::Actor .

◆ OnRender()

void kiwano::DebugActor::OnRender ( RenderContext ctx)
overridevirtual

渲染角色

每帧画面刷新时调用该函数,默认不进行渲染,重载该函数以实现具体渲染过程

参数
ctx渲染上下文

重载 kiwano::Actor .

◆ OnUpdate()

void kiwano::DebugActor::OnUpdate ( Duration  dt)
overridevirtual

更新角色

每帧画面刷新前调用该函数,重载该函数以实现角色的更新处理

参数
dt距上一次更新的时间间隔

重载 kiwano::Actor .