armature
来源:互联网 发布:淘宝永久封店保证金 编辑:程序博客网 时间:2024/06/05 17:31
-- 获取Armature配置文件路径
function GetArmatureFilePath(name)local armatureResourceRelativePaths = {"res/image/sprite/","res/image/effect/",}for i=1,#armatureResourceRelativePaths dolocal relativePath = armatureResourceRelativePaths[i]..name.."/"local relativeFileName = relativePath..name..".ExportJson"local isExist = cc.FileUtils:getInstance():isFileExist(relativeFileName)if isExist thenreturn relativeFileNameendendreturn nilend function ArmatureResourceManager:loadArmature(name)if name == nil thenreturn falseend local armatureDataManager = ccs.ArmatureDataManager:getInstance()local animationData = armatureDataManager:getAnimationData(name)if nil == animationData thenlocal resourcePath = GetArmatureFilePath(name)if resourcePath thenarmatureDataManager:addArmatureFileInfo(resourcePath)elsecclog(string.format("Failure to found Armature '%s' in ArmatureResourceList", name))return falseendendreturn trueend
-- 特效-armature
local effectName = 'ef_weilan'local ret = ArmatureResourceManager.getInstance():loadArmature(effectName)if ret then self.mEffectSprite = ccs.Armature:create(effectName) local effectPosition = cc.p(500,500) self.mEffectSprite:setPosition(effectPosition) self:addChild(self.mEffectSprite) self.mEffectSprite:getAnimation():playWithIndex(0) -- 参数 armature,完成程度,动作名称(idle) ,动作完成后的回调 local function animationEvent(armatureBack, movementType,movementID) local id = movementID if movementType == ccs.MovementEventType.complete then end end self.mEffectSprite:getAnimation():setMovementEventCallFunc(animationEvent) endfarmature = ccs.Armature:create("n02")farmature :getAnimation():play("idle01")-- 初始化为第0帧bgComponentluobo:getAnimation():gotoAndPause(0)
0 0
- armature
- XML动画Armature
- cocos2dx中播放Armature动画
- 一个cocostudio的Armature的setMovementEventCallFunc问题
- cocos2d的armature绑定到其他armature骨骼上的bug
- cocos2d-html5 armature问题 ccs is not defined
- quick-cocos2d-x 学习系列之三Armature
- Cocos2d-x的骨骼动画Spine和Armature
- 【Unity&DragonBones】如何使得骨架Armature下的物体透明
- Cocos2d-x中替换动画(Armature)中的节点与粒子
- Cocos2d-x中替换动画(Armature)中的节点与粒子
- cocos2d-x-2.2.1的ccs绑定完结(gui+scene+armature)
- 写个关于使用cocostudio Armature实现动画自由切换的小demo
- Cocos2d-JS下往Sprite SkeletonAnimation Armature(骨骼动画)添加shader
- 2015阿里实习生招聘一题解析4
- Linux 进程间通信(posix消息队列 简单)实例
- 703n TTL 救砖教程
- Android混淆时出现的proguard returned with error code 1.See console问题
- Android学习(第一天)
- armature
- Unity中利用UGUI添加滑动页面和滑动条
- Android应用程序的五大基本组件
- 开复老师最近说的
- Tp-Link wr1043nd使用安全模式還原設定(適合Tp-Link系列)
- 用户管理
- Android开发者指南-运动传感器Motion Sensor
- TPLINK WR-703N刷openwrt心得
- jquery: click()与bind('click')的区别