javascript - Cocos2D-JS can't load json file exported from CocosStudio -


i'm trying load json file exported cocosstudio v2.3.2

var myscene = ccs.scenereader.createnodewithscenefile('res/scene.json'); 

i got code sample-cocos2d-js-scene-gui-master
problem is, error: can't find parser : undefined

how fix issue?
i'm new using javascript , hope can me this. thank you.

try use ccs.load("") it's new api. function returns table {node, action} node it's scene "node" , "action" it's time line action it's optional.

code this:

var sceneres = ccs.load("res/scene.json"); this.addchild(sceneres.node); 

and if want use action, run node.

sceneres.node.runaction(sceneres.action); sceneres.action.gotoframeandplay(0, true); 

hope help, , sorry english


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -