![]() |
Kiwano Engine v1.3.x
|
舞台 更多...
#include <Stage.h>
Public 成员函数 | |
virtual void | OnEnter () |
进入舞台时 更多... | |
virtual void | OnExit () |
退出舞台时 更多... | |
RefPtr< Brush > | GetBorderFillBrush () const |
获取角色边界填充画刷 | |
RefPtr< Brush > | GetBorderStrokeBrush () const |
获取角色边界轮廓画刷 | |
void | SetBorderFillBrush (RefPtr< Brush > brush) |
设置角色边界填充画刷 | |
void | SetBorderStrokeBrush (RefPtr< Brush > brush) |
设置角色边界轮廓画刷 | |
![]() | |
virtual void | OnUpdate (Duration dt) |
更新角色 更多... | |
virtual void | OnRender (RenderContext &ctx) |
渲染角色 更多... | |
bool | IsVisible () const |
获取显示状态 | |
bool | IsCascadeOpacityEnabled () const |
是否启用级联透明度 | |
size_t | GetHashName () const |
获取名称的 Hash 值 | |
int | GetZOrder () const |
获取 Z 轴顺序 | |
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 |
获取缩放后的大小 | |
Point | GetAnchor () const |
获取锚点 | |
float | GetAnchorX () const |
获取 x 方向锚点 | |
float | GetAnchorY () const |
获取 y 方向锚点 | |
float | GetOpacity () const |
获取透明度 | |
float | GetDisplayedOpacity () const |
获取显示透明度 | |
float | GetRotation () const |
获取旋转角度 | |
Point | GetScale () const |
获取缩放比例 | |
float | GetScaleX () const |
获取横向缩放比例 | |
float | GetScaleY () const |
获取纵向缩放比例 | |
Point | GetSkew () const |
获取错切角度 | |
float | GetSkewX () const |
获取横向错切角度 | |
float | GetSkewY () const |
获取纵向错切角度 | |
Transform | GetTransform () const |
获取变换 | |
Actor * | GetParent () const |
获取父角色 | |
Stage * | GetStage () const |
获取所在舞台 | |
virtual Rect | GetBounds () const |
获取边框 更多... | |
virtual Rect | GetBoundingBox () const |
获取外切包围盒 更多... | |
const Matrix3x2 & | GetTransformMatrix () const |
获取二维变换矩阵 | |
const Matrix3x2 & | GetTransformInverseMatrix () const |
获取二维变换的逆矩阵 | |
const Matrix3x2 & | GetTransformMatrixToParent () const |
获取变换到父角色的二维变换矩阵 | |
void | SetVisible (bool val) |
设置角色是否可见 | |
void | SetName (StringView name) |
设置名称 | |
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) |
移动相对坐标 | |
void | SetScale (const Vec2 &scale) |
设置缩放比例,默认为 (1.0, 1.0) | |
void | SetScale (float scalex, float scaley) |
设置缩放比例,默认为 (1.0, 1.0) | |
void | SetSkew (const Vec2 &skew) |
设置错切角度,默认为 (0, 0) | |
void | SetSkew (float skewx, float skewy) |
设置错切角度,默认为 (0, 0) | |
void | SetRotation (float rotation) |
设置旋转角度,默认为 0 | |
void | SetAnchor (const Vec2 &anchor) |
设置锚点位置,默认为 (0, 0), 范围 [0, 1] | |
void | SetAnchor (float anchorx, float anchory) |
设置锚点位置,默认为 (0, 0), 范围 [0, 1] | |
void | SetSize (const Size &size) |
修改大小 | |
void | SetSize (float width, float height) |
修改大小 | |
void | SetWidth (float width) |
修改宽度 | |
void | SetHeight (float height) |
修改高度 | |
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< Actor > | GetChild (StringView name) const |
获取名称相同的子角色 | |
Vector< RefPtr< Actor > > | GetChildren (StringView name) const |
获取所有名称相同的子角色 | |
ActorList & | GetAllChildren () |
获取全部子角色 | |
const ActorList & | GetAllChildren () 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) |
渲染角色边界 | |
void | DoSerialize (Serializer *serializer) const override |
序列化 更多... | |
void | DoDeserialize (Deserializer *deserializer) override |
反序列化 更多... | |
![]() | |
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 |
判断对象是否有效 更多... | |
ObjectStatus * | GetStatus () const |
获取对象状态 | |
void | SetStatus (const ObjectStatus &status) |
设置对象状态 | |
void | Fail (StringView msg, int code=ObjectStatus::fail) |
将对象标记为失败状态 | |
void | ClearStatus () |
清除对象状态 | |
![]() | |
void | Retain () |
增加引用计数 | |
void | Release () |
减少引用计数 | |
uint32_t | GetRefCount () const |
获取引用计数 | |
![]() | |
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 |
执行反序列化 更多... | |
![]() | |
Animation * | AddAnimation (RefPtr< Animation > animation) |
添加动画 | |
Animation * | StartAnimation (RefPtr< Animation > animation) |
开始动画 | |
void | ResumeAllAnimations () |
继续所有暂停动画 | |
void | PauseAllAnimations () |
暂停所有动画 | |
void | StopAllAnimations () |
停止所有动画 | |
Animation * | GetAnimation (StringView name) |
获取指定名称的动画 更多... | |
const AnimationList & | GetAllAnimations () const |
获取所有动画 | |
void | Update (Actor *target, Duration dt) |
更新动画 | |
![]() | |
Task * | AddTask (RefPtr< Task > task) |
添加任务 | |
Task * | AddTask (const Task::Callback &cb, RefPtr< Ticker > ticker) |
添加任务 更多... | |
Task * | AddTask (StringView name, const Task::Callback &cb, RefPtr< Ticker > ticker) |
添加任务 更多... | |
Task * | AddTask (const Task::Callback &cb, Duration interval, int times=-1) |
添加任务 更多... | |
Task * | AddTask (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 TaskList & | GetAllTasks () const |
获取所有任务 | |
void | Update (Duration dt) |
更新调度器 | |
![]() | |
EventListener * | AddListener (RefPtr< EventListener > listener) |
添加监听器 | |
EventListener * | AddListener (EventType type, EventListener::Callback callback) |
添加监听器 更多... | |
EventListener * | AddListener (StringView name, EventType type, EventListener::Callback callback) |
添加监听器 更多... | |
template<typename _EventTy > | |
EventListener * | AddListener (EventListener::Callback callback) |
添加监听器 更多... | |
template<typename _EventTy > | |
EventListener * | AddListener (StringView name, EventListener::Callback callback) |
添加监听器 更多... | |
void | StartListeners (StringView name) |
启动监听器 更多... | |
void | StopListeners (StringView name) |
停止监听器 更多... | |
void | RemoveListeners (StringView name) |
移除监听器 更多... | |
void | StartAllListeners () |
启动所有监听器 | |
void | StopAllListeners () |
停止所有监听器 | |
void | RemoveAllListeners () |
移除所有监听器 | |
const ListenerList & | GetAllListeners () const |
获取所有监听器 | |
virtual bool | DispatchEvent (Event *evt) |
分发事件 更多... | |
![]() | |
Component * | AddComponent (RefPtr< Component > component) |
添加组件 更多... | |
Component * | AddComponent (size_t index, RefPtr< Component > component) |
添加组件 更多... | |
Component * | GetComponent (StringView name) |
获取组件 | |
Component * | GetComponent (size_t name_hash) |
获取组件 | |
ComponentMap & | GetAllComponents () |
获取所有组件 | |
const ComponentMap & | GetAllComponents () 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) |
渲染组件 | |
Protected 成员函数 | |
void | RenderBorder (RenderContext &ctx) override |
绘制所有子角色的边界 更多... | |
![]() | |
virtual void | Update (Duration dt) |
更新自身和所有子角色 更多... | |
void | UpdateSelf (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) |
设置节点所在舞台 | |
Flag< uint8_t > & | GetDirtyFlag () const |
![]() | |
IntrusiveListValue (value_type rhs) | |
const value_type & | GetPrev () const |
获取前一元素 | |
value_type & | GetPrev () |
获取前一元素 | |
const value_type & | GetNext () const |
获取下一元素 | |
value_type & | GetNext () |
获取下一元素 | |
![]() | |
ComponentManager (Actor *target) | |
![]() | |
IntrusiveListValue (value_type rhs) | |
const value_type & | GetPrev () const |
获取前一元素 | |
value_type & | GetPrev () |
获取前一元素 | |
const value_type & | GetNext () const |
获取下一元素 | |
value_type & | GetNext () |
获取下一元素 | |
友元 | |
class | Transition |
class | Director |
额外继承的成员函数 | |
![]() | |
typedef Function< void(Duration)> | UpdateCallback |
角色更新回调函数 | |
![]() | |
static void | SetDefaultAnchor (float anchor_x, float anchor_y) |
设置默认锚点 | |
![]() | |
static void | SetObjectPolicy (const ObjectPolicyFunc &policy) |
设置对象处理策略 | |
static bool | IsTracingLeaks () |
是否启用了内存泄漏追踪 | |
static void | StartTracingLeaks () |
开始追踪内存泄漏 | |
static void | StopTracingLeaks () |
停止追踪内存泄漏 | |
static void | DumpTracingObjects () |
打印所有追踪中的对象信息 | |
static Vector< ObjectBase * > & | GetTracingObjects () |
获取所有追踪中的对象 | |
![]() | |
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 |
![]() | |
enum | DirtyFlag : uint8_t { Clean = 0 , DirtyTransform = 1 , DirtyTransformInverse = 1 << 1 , DirtyOpacity = 1 << 2 , DirtyVisibility = 1 << 3 } |
![]() | |
using | value_type = typename std::pointer_traits< EventDispatcher * >::pointer |
using | reference = value_type & |
using | pointer = value_type * |
![]() | |
using | value_type = typename std::pointer_traits< RefPtr< Actor > >::pointer |
using | reference = value_type & |
using | pointer = value_type * |
|
virtual |
进入舞台时
重载该函数以处理进入舞台前的行为
|
virtual |
退出舞台时
重载该函数以处理退出舞台前的行为
|
overrideprotectedvirtual |
绘制所有子角色的边界
重载 kiwano::Actor .