AR_Engine_SDK
函数 | 变量
XSkeleton2dRenderComponent.lua 文件参考

#include <XSkeleton2dRenderComponent.h>

类 XSkeleton2dRenderComponent 继承关系图:
Inheritance graph

#include <XSkeleton2dRenderComponent.h>

XSkeleton2dRenderComponent::AniQueueData 的协作图:
Collaboration graph

#include <XSkeleton2dRenderComponent.h>

XSkeleton2dVertexEffectDelegate 的协作图:
Collaboration graph

函数

function XSkeleton2dRenderComponent Create (pNode) end
 
function XSkeleton2dRenderComponent Create () end
 
function XSkeleton2dRenderComponent Reset () end
 
function XSkeleton2dRenderComponent LoadAsset (asset) end
 
function XSkeleton2dRenderComponent GetAsset () end
 
function XSkeleton2dRenderComponent SetCurAnimationName (name) end
 
function XSkeleton2dRenderComponent GetCurAnimationName () end
 
function XSkeleton2dRenderComponent SetAnimation (name, loop, trackIndex) end
 
function XSkeleton2dRenderComponent AddAnimation (name, loop, delay, trackIndex) end
 
function XSkeleton2dRenderComponent SetTrackListener (entryid, listener, type) end
 
function XSkeleton2dRenderComponent SetTrackEventListener (entryid, listener) end
 
function XSkeleton2dRenderComponent SetCurAnimationIndex (index) end
 
function XSkeleton2dRenderComponent GetCurAnimationIndex () end
 
function XSkeleton2dRenderComponent ClearTracks () end
 
function XSkeleton2dRenderComponent ClearTrack (trackIndex) end
 
function XSkeleton2dRenderComponent SetToSetupPose () end
 
function XSkeleton2dRenderComponent SetBonesToSetupPose () end
 
function XSkeleton2dRenderComponent SetSlotsToSetupPose () end
 
function XSkeleton2dRenderComponent UpdateAnimationCache (animName) end
 
function XSkeleton2dRenderComponent InvalidAnimationCache () end
 
function XSkeleton2dRenderComponent SetSkin (skinName) end
 
function XSkeleton2dRenderComponent SetDefaultSkinIndex (index) end
 
function XSkeleton2dRenderComponent GetDefaultSkinIndex () end
 
function XSkeleton2dRenderComponent SetAttachment (slotName, attachmentName) end
 
function XSkeleton2dRenderComponent SetMix (fromAnimation, toAnimation, duration) end
 
function XSkeleton2dRenderComponent SetListener (listener, type) end
 
function XSkeleton2dRenderComponent SetEventListener (listener) end
 
function XSkeleton2dRenderComponent SetOpacityModifyRGB (value) end
 
function XSkeleton2dRenderComponent IsOpacityModifyRGB () end
 
function XSkeleton2dRenderComponent SetLoop (loop) end
 
function XSkeleton2dRenderComponent IsLoop () end
 
function XSkeleton2dRenderComponent SetTimeScale (scale) end
 
function XSkeleton2dRenderComponent GetTimeScale () end
 
function XSkeleton2dRenderComponent SetUseTint (enabled) end
 
function XSkeleton2dRenderComponent IsUseTint () end
 
function XSkeleton2dRenderComponent SetSlotsRange (startSlotIndex, endSlotIndex) end
 
function XSkeleton2dRenderComponent Skeleton2DSpaceToNodeSpace (point) end
 
function XSkeleton2dRenderComponent NodeSpaceToSkeleton2DSpace (point) end
 
function XSkeleton2dRenderComponent SetScale (scale) end
 
function XSkeleton2dRenderComponent GetScale () end
 

变量

 XSkeleton2dRenderComponent = {}
 

函数说明

◆ AddAnimation()

function XSkeleton2dRenderComponent AddAnimation ( name  ,
loop  ,
delay  ,
trackIndex   
)

添加一个动画到动画队列尾部,还可以延迟指定的秒数。缓存模式下,trackIndex应设置为0

参数
namecppstring
loopboolean
delaynumber
trackIndexnumber trackIndex轨道索引,缓存模式不用设置
返回
number

◆ ClearTrack()

function XSkeleton2dRenderComponent ClearTrack ( trackIndex  )

清除出指定 track 的动画状态。

参数
trackIndexnumber
返回
void

◆ ClearTracks()

function XSkeleton2dRenderComponent ClearTracks ( )

清除所有 track 的动画状态。

返回
void

◆ Create() [1/2]

function XSkeleton2dRenderComponent Create ( )

XSkeleton2dRenderComponent_Create01

返回
XSkeleton2dRenderComponent

◆ Create() [2/2]

function XSkeleton2dRenderComponent Create ( pNode  )

创建一个XSkeleton2dRenderComponent渲染组件

参数
pNodeXUINode 目标节点
返回
XSkeleton2dRenderComponent 创建出的XSkeleton2dRenderComponent组件

◆ GetAsset()

function XSkeleton2dRenderComponent GetAsset ( )

获取2d骨骼资源

返回
string

◆ GetCurAnimationIndex()

function XSkeleton2dRenderComponent GetCurAnimationIndex ( )

XSkeleton2dRenderComponent_GetCurAnimationIndex00

返回
number

◆ GetCurAnimationName()

function XSkeleton2dRenderComponent GetCurAnimationName ( )

XSkeleton2dRenderComponent_GetCurAnimationName00

返回
cppstring

◆ GetDefaultSkinIndex()

function XSkeleton2dRenderComponent GetDefaultSkinIndex ( )

XSkeleton2dRenderComponent_GetDefaultSkinIndex00

返回
number

◆ GetScale()

function XSkeleton2dRenderComponent GetScale ( )

XSkeleton2dRenderComponent_GetScale00

返回
number

◆ GetTimeScale()

function XSkeleton2dRenderComponent GetTimeScale ( )

XSkeleton2dRenderComponent_GetTimeScale00

返回
number

◆ InvalidAnimationCache()

function XSkeleton2dRenderComponent InvalidAnimationCache ( )

使动画缓存失效,之后会在每帧重新计算。

返回
void

◆ IsLoop()

function XSkeleton2dRenderComponent IsLoop ( )

XSkeleton2dRenderComponent_IsLoop00

返回
boolean

◆ IsOpacityModifyRGB()

function XSkeleton2dRenderComponent IsOpacityModifyRGB ( )

XSkeleton2dRenderComponent_IsOpacityModifyRGB00

返回
boolean

◆ IsUseTint()

function XSkeleton2dRenderComponent IsUseTint ( )

XSkeleton2dRenderComponent_IsUseTint00

返回
boolean

◆ LoadAsset()

function XSkeleton2dRenderComponent LoadAsset ( asset  )

加载2d骨骼资源

参数
assetstring
返回
boolean

◆ NodeSpaceToSkeleton2DSpace()

function XSkeleton2dRenderComponent NodeSpaceToSkeleton2DSpace ( point  )

XSkeleton2dRenderComponent_NodeSpaceToSkeleton2DSpace00

参数
pointXVECTOR2
返回
XVECTOR2

◆ Reset()

function XSkeleton2dRenderComponent Reset ( )

重置

返回
boolean

◆ SetAnimation()

function XSkeleton2dRenderComponent SetAnimation ( name  ,
loop  ,
trackIndex   
)

设置当前动画。队列中的任何的动画将被清除。缓存模式下,trackIndex应设置为0

参数
namecppstring
loopboolean
trackIndexnumber trackIndex轨道索引,缓存模式不用设置
返回
number TrackEntryid

◆ SetAttachment()

function XSkeleton2dRenderComponent SetAttachment ( slotName  ,
attachmentName   
)

通过 slot 和 attachment 的名字来设置 attachment。 Skeleton 优先查找它的皮肤,然后才是 Skeleton Data 中默认的皮肤。

参数
slotNamecppstring
attachmentNamecppstring
返回
void

◆ SetBonesToSetupPose()

function XSkeleton2dRenderComponent SetBonesToSetupPose ( )

设置 bone 到起始动作 使用 SkeletonData 中的 BoneData 列表中的值

返回
void

◆ SetCurAnimationIndex()

function XSkeleton2dRenderComponent SetCurAnimationIndex ( index  )

设置/获取当前播放的动画索引。

参数
indexnumber index索引,默认-1
返回
void

◆ SetCurAnimationName()

function XSkeleton2dRenderComponent SetCurAnimationName ( name  )

设置/获取当前播放的动画名称。

参数
namecppstring name动画名称
返回
void

◆ SetDefaultSkinIndex()

function XSkeleton2dRenderComponent SetDefaultSkinIndex ( index  )

设置/获取默认皮肤索引。

参数
indexnumber index索引,默认-1
返回
void

◆ SetEventListener()

function XSkeleton2dRenderComponent SetEventListener ( listener  )

用来设置动画播放过程中帧事件的监听。

参数
listenerXSkeleton2DEventListener
返回
void

◆ SetListener()

function XSkeleton2dRenderComponent SetListener ( listener  ,
type   
)

用来设置动画的事件监听。

参数
listenerXSkeleton2DAnimationListener
typenumber
返回
void

◆ SetLoop()

function XSkeleton2dRenderComponent SetLoop ( loop  )

是否循环播放当前骨骼动画。

参数
loopboolean
返回
void

◆ SetMix()

function XSkeleton2dRenderComponent SetMix ( fromAnimation  ,
toAnimation  ,
duration   
)

为所有关键帧设定混合及混合时间(从当前值开始差值)。

参数
fromAnimationcppstring
toAnimationcppstring
durationnumber
返回
void

◆ SetOpacityModifyRGB()

function XSkeleton2dRenderComponent SetOpacityModifyRGB ( value  )

是否启用贴图预乘。

参数
valueboolean
返回
void

◆ SetScale()

function XSkeleton2dRenderComponent SetScale ( scale  )

XSkeleton2dRenderComponent_SetScale00

参数
scalenumber
返回
void

◆ SetSkin()

function XSkeleton2dRenderComponent SetSkin ( skinName  )

按名称查找皮肤,激活该皮肤。这里对每个皮肤的名称进行了比较。 注意:设置皮肤不会改变 attachment 的可见性。

参数
skinNamecppstring
返回
void

◆ SetSlotsRange()

function XSkeleton2dRenderComponent SetSlotsRange ( startSlotIndex  ,
endSlotIndex   
)

设置骨骼插槽可视范围,设置[-1,-1]清除此范围。仅限非缓存模式使用

参数
startSlotIndexnumber
endSlotIndexnumber
返回
void

◆ SetSlotsToSetupPose()

function XSkeleton2dRenderComponent SetSlotsToSetupPose ( )

设置 slot 到起始动作 使用 SkeletonData 中的 SlotData 列表中的值

返回
void

◆ SetTimeScale()

function XSkeleton2dRenderComponent SetTimeScale ( scale  )

当前骨骼中所有动画的时间缩放率。

参数
scalenumber
返回
void

◆ SetToSetupPose()

function XSkeleton2dRenderComponent SetToSetupPose ( )

还原到起始动作。

返回
void

◆ SetTrackEventListener()

function XSkeleton2dRenderComponent SetTrackEventListener ( entryid  ,
listener   
)

用来为指定的 TrackEntry 设置动画播放过程中帧事件的监听。

参数
entryidnumber
listenerXSkeleton2DEventListener
返回
void

◆ SetTrackListener()

function XSkeleton2dRenderComponent SetTrackListener ( entryid  ,
listener  ,
type   
)

用来为指定的 TrackEntry 设置动画的事件监听。

参数
entryidnumber
listenerXSkeleton2DAnimationListener
typenumber
返回
void

◆ SetUseTint()

function XSkeleton2dRenderComponent SetUseTint ( enabled  )

是否启用染色效果。

参数
enabledboolean
返回
void

◆ Skeleton2DSpaceToNodeSpace()

function XSkeleton2dRenderComponent Skeleton2DSpaceToNodeSpace ( point  )

XSkeleton2dRenderComponent_Skeleton2DSpaceToNodeSpace00

参数
pointXVECTOR2
返回
XVECTOR2

◆ UpdateAnimationCache()

function XSkeleton2dRenderComponent UpdateAnimationCache ( animName  )

更新某个动画缓存, 预计算动画中所有帧数据,由于在单帧计算所有数据,所以较消耗性能。 若想更新缓存,可使用 InvalidAnimationCache 方法,具有较高性能。

参数
animNamecppstring
返回
void

变量说明

◆ XSkeleton2dRenderComponent