用的cocos2dx版本是2.2.2代码:
–加载到container
CCArmatureDataManager:sharedArmatureDataManager():addArmatureFileInfo(pngPath, plistPath, jsonPath)
local armature = CCArmature:create(path)
g_trace("动画类型: " … type(armature))
armature:getAnimation():playWithIndex(0)
commanderContainer:addNode(armature)
其中的对象 都存在,commanderContainer是一个容量层
错误信息:
LUA ERROR: :116: attempt to call method ‘addNode’ (a nil value)
我在C++能打出addNode的呀。
CCArmature要加在node中,widget不能添加CCArmature
commanderContainer是一个容器层