大约有 8 项符合查询结果, 库内数据总量为 30,935 项。 (搜索耗时: 0.0035 秒)
...例中 this.uiBtn.on 是使用了持续侦听。 2.2.3 单次事件侦听 once /** * 使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知,此侦听事件响应一次后自动移除。 * @param type 事件的类型。 * @param caller 事...
来源: Laya3.0_文档 发布时间: 20240910
...果。 1. 帧间隔 1.1 定时执行一次 (基于帧率) Laya.timer.frameOnce,定义如下: /** * 定时执行一次(基于帧率)。 * @param delay 延迟几帧(单位为帧)。 * @param caller 执行域(this)。 * @param method 定时器回调函数。 * @param args 回调参数。 * @param c...
来源: Laya3.0_文档 发布时间: 20240910
...新建一个data.txt文件 //设置完成事件,添加回调方法 http.once(Laya.Event.COMPLETE, this, this.completeHandler); //设置错误事件,添加回调方法 http.once(Laya.Event.ERROR, this, this.errorHandler); //设置进度事件,添加回调方法 http.on(Laya.Event.PROGRESS, this...
来源: Laya3.0_文档 发布时间: 20250104
... //请求完成后触发,表示响应数据已经完全接收。 this.hr.once(Event.COMPLETE, this, this.onHttpRequestComplete); //请求出错时触发,常用于网络故障等异常情况。 this.hr.once(Event.ERROR, this, this.onHttpRequestError); //示例中的URL为临时测试的地址,...
来源: Laya3.0_文档 发布时间: 20250310
...按钮触发,则传入关闭按钮的名字(name),否则为null。 */ onClosed(type: string = null): void { } 场景的Runtime类,当场景关闭的时候,会被调用 onClosed() 方法,可以在方法内实现各种资源的释放 2.4 场景的加载页面 Laya.Scene.setLoadingPage(loadPa...
来源: Laya3.0_文档 发布时间: 20240910
... url:string = "http://layabox.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); 编译运行上面的代码,然后点击舞台可以看到,二维码已经显示到了舞台上,可以用手...
来源: Laya3.0_文档 发布时间: 20240910
...为了本地看效果延迟一秒,真实项目不需要延迟 Laya.timer.once(1000, this, () => { //跳转到入口场景 Laya.Scene.open("Scenes/Index.ls"); //不要使用Laya.Scene.open("./Scenes/Index.ls"); }); }); // 侦听加载失败 Laya.loader.on(Laya.Event.ERROR, this, this.onError); }...
来源: Laya3.0_文档 发布时间: 20241014
...为了本地看效果延迟一秒,真实项目不需要延迟 Laya.timer.once(1000, this, () => { //跳转到入口场景 Laya.Scene.open("Scenes/Index.ls"); //不要使用Laya.Scene.open("./Scenes/Index.ls"); }); }); // 侦听加载失败 Laya.loader.on(Laya.Event.ERROR, this, this.onError); }...
来源: Laya3.0_文档 发布时间: 20250310