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"))
cocos2dx使用cocostudio导出的scene,布布扣,bubuko.com
原文:http://www.cnblogs.com/marcher/p/3794780.html