首页 > 其他 > 详细

cocos2dx使用cocostudio导出的animation

时间:2014-06-21 10:20:05      阅读:563      评论:0      收藏:0      [点我收藏+]

local ui
local function createLayerUI()
if not ui then
ui=cc.Layer:create();
createLayerUI=nil;
end
return ui;
end

local sc
local function createLayerScene()
if not sc then
sc=cc.Layer:create();
createLayerScene=nil;
end
return sc;
end

local entity
local function createLayerEntity()
if not entity then
entity=cc.Layer:create();
createLayerEntity=nil;
end
return entity;
end

cc.FileUtils:getInstance():addSearchPath("res")
local sceneGame=cc.Scene:create()
sceneGame:addChild(createLayerUI())
cc.Director:getInstance():runWithScene(sceneGame)
--ui:addChild(ccs.GUIReader:shareReader():widgetFromJsonFile("res/SampleChangeEquip_1.json"))
print("format", tostring({}))

sceneGame:addChild(createLayerScene())
local node =ccs.SceneReader:getInstance():createNodeWithSceneFile("res/RPGGame.json")
sc:addChild(node)
node:setPosition(-200,-100)

sceneGame:addChild(createLayerEntity())
ccs.ArmatureDataManager:getInstance():addArmatureFileInfo("res/DemoPlayer.ExportJson");
local armature = ccs.Armature:create("DemoPlayer");
armature:setPosition(200, 200);
armature:setScaleX(0.2);
armature:setScaleY(0.2);
entity:addChild(armature);
armature:getAnimation():play("walk")

bubuko.com,布布扣

bubuko.com,布布扣

cocos2dx使用cocostudio导出的animation,布布扣,bubuko.com

cocos2dx使用cocostudio导出的animation

原文:http://www.cnblogs.com/marcher/p/cocos2dxanimation.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!