1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local Skeleton = class("Skeleton", function()
return display.newSprite()
end)


function Skeleton:ctor()
-- 加载骨骼资源
ccs.ArmatureDataManager:getInstance():addArmatureFileInfo("cyborg.png", "cyborg.plist", "cyborg.xml")
-- addArmatureFileInfo("png名","plist名","xml名字")

-- 创建
local armature3 = ccs.Armature:create("cyborg") -- 骨骼名
armature3:getAnimation():play("run") -- 动作名
armature3:setPosition(display.cx, display.cy)
self:addChild(armature3)

end


return Skeleton