• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 5 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0017 秒)

1. 鼠标交互-鼠标交互 [ 100%]

... = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, this.mouseHandler); rect.on(Event.MOUSE_UP, this, this.mouseHandler); rect.on(Event.CLICK, this, this.mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, this.mouseHandler); rect.on(Eve...

来源: Laya2.0_示例 发布时间: 20240930

2. 计时器-延迟执行 [ 97%]

...ton; } onDecreaseAlpha1(e) { const Event = Laya.Event; //移除鼠标单击事件 this.button1.off(Event.CLICK, this, this.onDecreaseAlpha1); //定时执行一次(间隔时间) Laya.timer.once(3000, this, this.onComplete1); } onDecreaseAlpha2(e) { const Event = Laya.Event; //移除鼠标单击事件...

来源: Laya2.0_示例 发布时间: 20240930

3. 屏幕适配-屏幕适配 [ 92%]

...("click", this, this.onBoyClick); Laya.stage.addChild(boy2); //侦听点击事件,输出坐标信息 Laya.stage.on("click", this, this.onClick); Laya.stage.on("resize", this, this.onResize); } onBoyClick(e) { //点击后小人会放大缩小 let boy = e.target; if (boy.scaleX === 1) { boy.scale(1....

来源: Laya2.0_示例 发布时间: 20240930

4. 鼠标交互-自定义事件 [ 87%]

...ld(this.sp); this.sp.on(ROTATE, this, this.onRotate); // 侦听自定义的事件 this.sp.on(Event.CLICK, this, this.onSpriteClick); } onSpriteClick(e) { let randomAngle = Math.random() * 180; //发送自定义事件 this.sp.event(ROTATE, [randomAngle]); } // 触发自定义的rotate事件 onRotate(...

来源: Laya2.0_示例 发布时间: 20240930

5. UI-RefreshList [ 67%]

...化场景 * */ /** 关联引擎的滚动限制接口 */ /**列表的鼠标事件处理,常用于处理单元格上的点击事件等 */ /** 列表单元格上的鼠标抬起时处理恢复逻辑 */ /** 列表当前单元格的鼠标移动事件的处理 * @paramthis.item = null; 单元格对象 * ...

来源: Laya2.0_示例 发布时间: 20240930