大约有 11 项符合查询结果, 库内数据总量为 30,935 项。 (搜索耗时: 0.0055 秒)
...图12-3所示。 (图12-3) 3.4 事件 需要在@bpClass标签中加入events,示例代码如下所示: const { bpClass, bpFunction } = BP; @bpClass({ name: "TestEvents", extends: "Sprite", construct: { params: [ { "name": "eee", "type": "string" } ] }, events: [{ name: "onTest", params: [{ n...
来源: Laya3.0_文档 发布时间: 20250103
...tion; } } /** * 监听鼠标事件 */ onAwake(): void { Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.mouseDown); Laya.stage.on(Laya.Event.MOUSE_UP, this, this.mouseUp); this.camera = (<Laya.Camera>this.owner); } /** * 监听键盘事件 */ onUpdate(): void { var elapsedTime: number = Laya.t...
来源: Laya3.0_文档 发布时间: 20250103
...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_文档 发布时间: 20250310
...nt, url);// 此处最好加延迟 //监听器注册 Laya.Browser.window.addEventListener("click", (event: any) => { console.log(event.type); }) Window.open() 方法、window.postMessage()方法、Window.addEventListener()方法 3.3 container 画布 LayaAir引擎里可以通过 Laya.Browser.contai...
来源: Laya3.0_文档 发布时间: 20240910
...过程,因此建立连接后,通常要注册以下事件监听器: Event.OPEN:连接成功建立后触发。 Event.MESSAGE:收到服务器发送的数据时触发。 Event.CLOSE:连接关闭时触发。 Event.ERROR:连接出错时触发。 示例代码: // 注册事件监听示例 th...
来源: Laya3.0_文档 发布时间: 20250310
...毕,此方法只执行一次 */ 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_文档 发布时间: 20250103
...代码中的使用如下: //鼠标按下时执行 onMouseDown(evt: Laya.Event): void { } //鼠标抬起时执行 onMouseUp(evt: Laya.Event): void { } //鼠标右键或中键按下时执行 onRightMouseDown(evt: Laya.Event): void { } //鼠标右键或中键抬起时执行 onRightMouseUp(evt: Laya.E...
来源: Laya3.0_文档 发布时间: 20250103
...ions", inspector: "Buttons", options : { buttons : [ { caption : "点我", event: "my_click" } ] } } ] } ]); this._panel.allowUndo = true; //根据需要设置 //如果不需要undo功能,也可以直接this._data = {}; this._data = IEditor.DataWatcher.watch({}); //inspect可以多次调用,将...
来源: Laya3.0_文档 发布时间: 20250310
...完毕,此方法只执行一次 */ onAwake(): void { this.uiBtn.on(Laya.Event.CLICK, this, () => { //点击后,打开Msg场景 Laya.Scene.open("Msg.ls", false, { "text": "点击成功!" }); }); } } 其中,Scene场景有一个Button组件,需要在IDE中,将其拖入到@property暴露...
来源: Laya3.0_文档 发布时间: 20240910
...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_文档 发布时间: 20240910