码迷,mamicode.com
首页 > 其他好文 > 详细

cocos2dx使用cocostudio导出的animation

时间:2014-06-21 10:22:02      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:blog   http   com   get   使用   2014   

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

标签:blog   http   com   get   使用   2014   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!