赞 | 15 |
VIP | 0 |
好人卡 | 0 |
积分 | 41 |
经验 | 1671 |
最后登录 | 2024-8-12 |
在线时间 | 440 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 4079
- 在线时间
- 440 小时
- 注册时间
- 2015-4-4
- 帖子
- 156
|
3楼
楼主 |
发表于 2018-10-24 12:53:52
|
只看该作者
removeChild该放到哪里,我之前试的都不管用
- Scene_BattleMenu.prototype.createBattleChapter = function(){
- var T_Buttons= [
- '001',
- '002',
- '003'
- ];
- var clicks=[
- function(){nowLookingChapter=1; this.createBattleLevel();},
- function(){nowLookingChapter=2; this.createBattleLevel();},
- function(){nowLookingChapter=3; this.createBattleLevel();}
- ];
- this._T_Buttons=[];
- for(var i in T_Buttons){
- var sprite=new Sprite_Button();
- sprite.bitmap=ImageManager.loadBitmap('img/battlechapter/',T_Buttons[i]);
- sprite.x=100;
- sprite.y=100+i*50;
- sprite.setClickHandler(clicks[i].bind(this));
- this._T_Buttons.push(sprite);
- this.addChild(sprite);
- };
- };
- Scene_BattleMenu.prototype.createBattleLevel = function(){
- var T_Buttons;
- switch(nowLookingChapter){
- case 1:
- T_Buttons= ['001_1','001_2','001_3','001_4'];
- break;
- case 2:
- T_Buttons= ['002_1','002_2','002_3','002_4'];
- break;
- case 3:
- T_Buttons= ['003_1','003_2','003_3','003_4'];
- break;
- }
- var clicks=[
- this.createBattlelevel,
- this.createBattlelevel,
- this.createBattlelevel,
- this.createBattlelevel
- ];
- this._T_Buttons=[];
- for(var i in T_Buttons){
- var BattleChapter=new Sprite_Button();
- BattleChapter.bitmap=ImageManager.loadBitmap('img/battlechapter/',T_Buttons[i]);
- var xzb = [700,1000,700,1000];
- var yzb = [200,200,360,360];
- BattleChapter.x=xzb[i];
- BattleChapter.y=yzb[i];
- BattleChapter.setClickHandler(clicks[i].bind(this));
- this._T_Buttons.push(BattleChapter);
- this.addChild(BattleChapter);
- };
- };
- Scene_BattleMenu.prototype.createBattlelevel = function(){
- };
复制代码 |
|