大约有 13 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0050 秒)
...是事件1.2 事件的分类2. 引擎内置的事件2.1 事件类型 Laya.Event2.2 事件派发 Laya.EventDispatcher2.3 事件处理 Laya.Handler3. 自定义的事件事件管理 1. 认识事件 1.1 什么是事件 事件Event指的是由系统事先设定的、能被对象识别和响应的动作...
来源: Laya3.0_文档 发布时间: 20251010
...ton}) public initBtn: Laya.Button; onEnable(): void { this.initBtn.on(Laya.Event.CLICK, this.onInit); } onInit() { alert(extendLib.initializeSteam()); } } 构建发布Windows后,需要在exe的同级目录下,新建一个steam_appid.txt 文件,其中只包含 AppID。 (图2-2) 在Steam客...
来源: Laya3.0_文档 发布时间: 20251010
...Laya.Script命名函数方式处理输入。例如: this.aNode.on(Laya.Event.CLICK, ()=> { console.log("clicked"); }); class MyScript extends Laya.Script { //脚本事件 onMouseClick(e:Event) { console.log("clicked"); } } aNode.addComponent(MyScript); 以上两种方式是等价的,且在纯...
来源: Laya3.0_文档 发布时间: 20251010
...platform.com/manifests/vM7nH0Kl.m3u8'); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED,function():void{ video.play(); }); } plyr.setup(video); } } new LayaUISample; 编译运行代码,发现网页已经可以播放视频了。开发者可能注意到这里我们初始化引擎的时候...
来源: Laya3.0_文档 发布时间: 20251010
...侦听器,而是直接侦听列表的ClickItem事件: list.on(Laya.UIEvent.ClickItem, this, this.onClickItem); // 回调函数的第一个参数就是当前被点击的对象 function onClickItem(item: GObject): void { console.log("点击了对象:" + item.title); //获得这个对象在列表...
来源: Laya3.0_文档 发布时间: 20251128
...Script extends RuntimeScriptBase { onAwake(): void { this.closeBtn.on(Laya.Event.CLICK, this, () => { this.close(); }); } } 1.3.3 关联场景 设置好弹窗之后,需要用代码将Dialog与所需要用到该Dialog的场景管关联起来。回到初始场景Scene,在Scene2D的属性设置...
来源: Laya3.0_文档 发布时间: 20251024
...毕,此方法只执行一次 */ onAwake(): void { this.sprite2.on(Laya.Event.MOUSE_DOWN, this, this.test2);//设置监听,sprite1或sprite2均可 console.log(this.sprite1.mouseEnabled);//打印父节点sprite1的MouseEnabled的值:true console.log(this.sprite2.mouseEnabled);//打印子节点sp...
来源: Laya3.0_文档 发布时间: 20251010
...ions", inspector: "Buttons", options : { buttons : [ { caption : "点我", event: "my_click" } ] } } ] } ]); this._panel.allowUndo = true; //根据需要设置 //如果不需要undo功能,也可以直接this._data = {}; this._data = IEditor.DataWatcher.watch({}); //inspect可以多次调用,将...
来源: Laya3.0_文档 发布时间: 20251010
... void { this.bar.value = 1; this.value.visible = false; Laya.stage.on(Laya.Event.CLICK, this, this.onHurt); } onHurt(): void { this.bar.value = this.bar.value - 0.9; this.value.y = 35; this.value.visible = true; Main.instance.animator.play("stun"); Laya.Tween.create(this.value).to("y", -30).duration...
来源: Laya3.0_文档 发布时间: 20251010
... 记录当前皮肤状态 //播放停止后执行逻辑 this.owner.on(Laya.Event.STOPPED, this, () => { // 通过三元运算符切换皮肤名称 currentSkin = currentSkin === "full-skins/girl" ? "full-skins/girl-blue-cape" : "full-skins/girl"; this.spine.skinName = currentSkin; this.spine.play(...
来源: Laya3.0_文档 发布时间: 20251128