cocos2d-x JS 加载播放Studio帧动画的两种方法


昨天懵逼的搞了两个多小时(百度无果/没看出什么矛头),自己琢磨总算搞出来了  
1. 
 1      var levelUpJson = ccs.load("res/LevelUp.json");  //注意加载资源问题  
 2 
 3         this.bg = levelUpJson.node;
 4         this.bg.setContentSize(WinSize);
 5         this.addChild(this.bg);
 6         ccui.helper.doLayout(this.bg);
 7 
 8         this.action = levelUpJson.action;
 9         this.bg.runAction(this.action);
10         //cocosStudio执行帧数
11         this.action.gotoFrameAndPlay(0, 75, true);

2.

1 //this.manga = ccs.uiReader.widgetFromJsonFile("res/image/beginnerguide/manga/manga.json");
2 //this.manga.setPosition(cc.p(0, 0));
3 //this.frame.addChild(this.manga, -1);
4 
5 //ccs.actionManager.playActionByName("manga.json", "Animation0");

 

 
 
 
 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM