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