首页 > 代码库 > cocos2dx使用cocostudio导出的scene

cocos2dx使用cocostudio导出的scene

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

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())
sc:addChild(ccs.SceneReader:getInstance():createNodeWithSceneFile("res/RPGGame.json"))