您的位置:首页 > 其它

骨骼动画

2015-10-09 15:00 246 查看
local manager = ccs.ArmatureDataManager:getInstance()

--manager:removeArmatureFileInfo("bear.ExportJson")

manager:addArmatureFileInfo("NewAnimation/NewAnimation.ExportJson")

print(manager)

local armature = ccs.Armature:create("NewAnimation")

print(armature)

armature:getAnimation():playWithIndex(0)

armature:getAnimation():setSpeedScale(1.2)

armature:setPosition(cc.p(display.cx, display.cy))

self:addChild(armature)

--添加plist骨骼动画

local plist = cc.ParticleSystemQuad:create("SmallSun.plist")

print(plist)

local bone = ccs.Bone:create("plist")

print(bone)

bone:addDisplay(plist, 0) --添加表现形式

bone:changeDisplayWithIndex(0,true) --切换变现形式

bone:setIgnoreMovementBoneData(true) --新增bone没有这个会被隐藏

bone:setLocalZOrder(100)

bone:setScale(0.5)

armature:addBone(bone, "zuo")
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: