Package | laya.ani.bone |
Class | public class Templet |
Inheritance | Templet AnimationTemplet laya.resource.Resource |
Property | Defined By | ||
---|---|---|---|
aniSectionDic : Object | Templet | ||
bindBoneBoneSlotDic : Object 绑定插槽数据的字典 | Templet | ||
boneSlotArray : Array 存放插糟数据的数组 | Templet | ||
boneSlotDic : Object 存放插槽数据的字典 | Templet | ||
deformAniArr : Array 顶点动画数据 | Templet | ||
drawOrderAniArr : Array 渲染顺序动画数据 | Templet | ||
eventAniArr : Array 事件动画数据 | Templet | ||
ikArr : Array IK数据 | Templet | ||
interpolation : Array [static] | AnimationTemplet | ||
isParseFail : Boolean = false 是否解析失败 | Templet | ||
isParserComplete : Boolean = false | Templet | ||
mBoneArr : Vector.<Bone> | Templet | ||
mRootBone : Bone | Templet | ||
pathArr : Array path数据 | Templet | ||
rate : Number | Templet | ||
skinDataArray : Array 皮肤数据 | Templet | ||
skinDic : Object 皮肤的字典数据 | Templet | ||
skinSlotDisplayDataArr : Vector.<SkinSlotDisplayData> 实际显示对象列表,用于销毁用 | Templet | ||
srcBoneMatrixArr : Array 存放原始骨骼信息 | Templet | ||
subTextureDic : Object 存放纹理数据 | Templet | ||
TEMPLET_DICTIONARY : Object [static] | Templet | ||
tfArr : Array transform数据 | Templet | ||
yReverseMatrix : Matrix 反转矩阵,有些骨骼动画要反转才能显示 | Templet |
Method | Defined By | ||
---|---|---|---|
buildArmature(aniMode:int = 0):Skeleton
创建动画
0,使用模板缓冲的数据,模板缓冲的数据,不允许修改 (内存开销小,计算开销小,不支持换装)
1,使用动画自己的缓冲区,每个动画都会有自己的缓冲区,相当耗费内存 (内存开销大,计算开销小,支持换装)
2,使用动态方式,去实时去画 (内存开销小,计算开销大,支持换装,不建议使用)
| Templet | ||
destroy():void
释放纹理
| Templet | ||
getAniDuration(aniIndex:int):int | AnimationTemplet | ||
getAnimation(aniIndex:int):* | AnimationTemplet | ||
getAnimationCount():int | AnimationTemplet | ||
getAnimationDataWithCache(key:*, cacheDatas:*, aniIndex:int, frameIndex:int):Float32Array | AnimationTemplet | ||
getAniNameByIndex(index:int):String
通过索引得动画名称
| Templet | ||
getNodeCount(aniIndex:int):int | AnimationTemplet | ||
getNodeIndexWithName(aniIndex:int, name:String):int | AnimationTemplet | ||
getNodes(aniIndex:int):* | AnimationTemplet | ||
getNodesCurrentFrameIndex(aniIndex:int, playCurTime:Number):Uint32Array | AnimationTemplet | ||
getOriginalData(aniIndex:int, originalData:Float32Array, nodesFrameIndices:Array, frameIndex:int, playCurTime:Number):void | AnimationTemplet | ||
getOriginalDataUnfixedRate(aniIndex:int, originalData:Float32Array, playCurTime:Number):void | AnimationTemplet | ||
getPublicExtData():ArrayBuffer | AnimationTemplet | ||
getSkinIndexByName(skinName:String):int
通过皮肤名字得到皮肤索引
| Templet | ||
getTexture(name:String):Texture
得到指定的纹理
| Templet | ||
getTotalkeyframesLength(aniIndex:int):int | AnimationTemplet | ||
load(url:String):AnimationTemplet [static]
加载动画模板。
| AnimationTemplet | ||
loadAni(url:String):void | Templet | ||
onAsynLoaded(url:String, data:*, params:Array):void [override]
private
| AnimationTemplet | ||
解析骨骼动画数据
| Templet | ||
setAnimationDataWithCache(key:*, cacheDatas:Array, aniIndex:int, frameIndex:Number, data:*):void | AnimationTemplet |
aniSectionDic | property |
public var aniSectionDic:Object
bindBoneBoneSlotDic | property |
public var bindBoneBoneSlotDic:Object
绑定插槽数据的字典
boneSlotArray | property |
public var boneSlotArray:Array
存放插糟数据的数组
boneSlotDic | property |
public var boneSlotDic:Object
存放插槽数据的字典
deformAniArr | property |
public var deformAniArr:Array
顶点动画数据
drawOrderAniArr | property |
public var drawOrderAniArr:Array
渲染顺序动画数据
eventAniArr | property |
public var eventAniArr:Array
事件动画数据
ikArr | property |
public var ikArr:Array
IK数据
isParseFail | property |
public var isParseFail:Boolean = false
是否解析失败
isParserComplete | property |
public var isParserComplete:Boolean = false
mBoneArr | property |
public var mBoneArr:Vector.<Bone>
mRootBone | property |
public var mRootBone:Bone
pathArr | property |
public var pathArr:Array
path数据
rate | property |
rate:Number
public function get rate():Number
public function set rate(value:Number):void
skinDataArray | property |
public var skinDataArray:Array
皮肤数据
skinDic | property |
public var skinDic:Object
皮肤的字典数据
skinSlotDisplayDataArr | property |
public var skinSlotDisplayDataArr:Vector.<SkinSlotDisplayData>
实际显示对象列表,用于销毁用
srcBoneMatrixArr | property |
public var srcBoneMatrixArr:Array
存放原始骨骼信息
subTextureDic | property |
public var subTextureDic:Object
存放纹理数据
TEMPLET_DICTIONARY | property |
public static var TEMPLET_DICTIONARY:Object
tfArr | property |
public var tfArr:Array
transform数据
yReverseMatrix | property |
public var yReverseMatrix:Matrix
反转矩阵,有些骨骼动画要反转才能显示
buildArmature | () | method |
public function buildArmature(aniMode:int = 0):Skeleton
创建动画 0,使用模板缓冲的数据,模板缓冲的数据,不允许修改 (内存开销小,计算开销小,不支持换装) 1,使用动画自己的缓冲区,每个动画都会有自己的缓冲区,相当耗费内存 (内存开销大,计算开销小,支持换装) 2,使用动态方式,去实时去画 (内存开销小,计算开销大,支持换装,不建议使用)
Parameters
aniMode:int (default = 0 ) — 0 动画模式,0:不支持换装,1,2支持换装
|
Skeleton —
|
destroy | () | method |
public function destroy():void
释放纹理
getAniNameByIndex | () | method |
public function getAniNameByIndex(index:int):String
通过索引得动画名称
Parameters
index:int |
String —
|
getSkinIndexByName | () | method |
public function getSkinIndexByName(skinName:String):int
通过皮肤名字得到皮肤索引
Parameters
skinName:String — 皮肤名称
|
int —
|
getTexture | () | method |
public function getTexture(name:String):Texture
得到指定的纹理
Parameters
name:String — 纹理的名字
|
Texture —
|
loadAni | () | method |
public function loadAni(url:String):void
Parameters
url:String |
parseData | () | method |
public function parseData(texture:Texture, skeletonData:ArrayBuffer, playbackRate:int = 30):void
解析骨骼动画数据
Parameters
texture:Texture — 骨骼动画用到的纹理
| |
skeletonData:ArrayBuffer — 骨骼动画信息及纹理分块信息
| |
playbackRate:int (default = 30 ) — 缓冲的帧率数据(会根据帧率去分帧)
|
complete | Event |
laya.events.Event.COMPLETE
Event.COMPLETE
数据解析完成后的调度。
error | Event |
laya.events.Event.ERROR
Event.ERROR
数据解析错误后的调度。