怎么转换场景HTML,请问UI之间的场景切换要怎么写

var sg_sign = (function(_super){

function sg_sign(){

sg_sign.super(this);

this.btn_wxsign.on(Laya.Event.CLICK,this,this.onWxSign);

this.reset();

}

Laya.class(sg_sign,"sg_sign",_super);

var _proto = sg_sign.prototype;

_proto.reset = function(){

Laya.SoundManager.playMusic('res/sound/sign_bgm.mp3',0);

}

_proto.onWxSign = function(e){

onWxSign1();

}

return sg_sign;

})(ui.sg_signUI);

var sg_index = (function(_super){

function sg_index(){

sg_index.super(this);

this.indexDz.on(Laya.Event.CLICK,this,this.onIndexDz);

this.reset();

}

Laya.class(sg_index,"sg_index",_super);

var _proto = sg_index.prototype;

//初始化UI函数

_proto.reset = function(){

Laya.SoundManager.playMusic('res/sound/index_bgm.mp3',0);

}

_proto.onIndexDz = function(e){

indexDz();

}

return sg_index;

})(ui.sg_indexUI);

Laya.init(1350,760,Laya.WebGL);

Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE;

Laya.stage.alignH = "center";

Laya.stage.scaleMode = "showall";

Laya.stage.screenMode = "horizontal";

Laya.loader.load("res/atlas/sanguo.json",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS);

function onLoaded(){

Laya.sg_sign = new sg_sign();

Laya.stage.addChild(Laya.sg_sign);

}

function onWxSign1(){

Laya.sg_sign.removeSelf();

Laya.Pool.recover("sg_sign",Laya.sg_sign);

Laya.sg_index = new sg_index();

Laya.stage.addChild(Laya.sg_index);

}

这样写可以吗

还有ui和代码创建出来 之间的切换要怎么写

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值