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

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

1. 鼠标交互-双指旋转(多点触控) [ 100%]

...0].stageX - touches[1].stageX); Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove); } } onMouseMove(e) { let touches = e.touches; if (touches && touches.length == 2) { let nowRadian = Math.atan2( touches[0].stageY - touches[1].stageY, touches[0].stageX - touches[1].stageX); this.sp.rotation += ...

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

2. 鼠标交互-双指缩放(多点触控) [ 98%]

...ce = this.getDistance(touches); Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove); } } onMouseMove(e) { let distance = this.getDistance(e.touches); //判断当前距离与上次距离变化,确定是放大还是缩小 const factor = 0.01; this.sp.scaleX += (distance - lastDistance) * factor;...

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

3. 鼠标交互-滑动 [ 96%]

...ent; //添加鼠标移到侦听 Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove); buttonPosition = this.button.x; Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } /**移到事件处理*/ onMouseMove(e) { this.button.x = Math.max(Math...

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

4. 其他引擎的Demo-Example_21 [ 95%]

...mousedown', this, this.onMouseDown); Laya.stage.on('mousemove', this, this.onMouseMove); Laya.stage.on('mouseup', this, this.onMouseUp); } createCanvases() { const Sprite = Laya.Sprite; let graphicsCanvas = new Sprite(); Laya.stage.addChild(graphicsCanvas); let liveGraphicsCanvas = new Sprite(); Lay...

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

5. Sprite-遮罩-放大镜 [ 88%]

...置mask this.bg2.mask = this.maskSp; Laya.stage.on("mousemove", this, this.onMouseMove); } private onMouseMove():void { this.bg2.x = -Laya.stage.mouseX * 2; this.bg2.y = -Laya.stage.mouseY * 2; this.maskSp.x = Laya.stage.mouseX; this.maskSp.y = Laya.stage.mouseY; } } } new laya.Sprite_MagnifyingGlas...

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