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

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

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

...hes[1].stageY, touches[0].stageX - touches[1].stageX); Laya.stage.on(Event.MOUSE_MOVE, this, onMouseMove); } } function onMouseMove(e) { var touches = e.touches; if (touches && touches.length == 2) { var nowRadian = Math.atan2( touches[0].stageY - touches[1].stageY, touches[0].stageX - touches[1].st...

来源: Laya_示例 发布时间: 20241123

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

...hes[1].stageY, touches[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...

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

3. 区块地图-滚动地图 [ 99%]

... = Laya.stage.mouseX; mLastMouseY = Laya.stage.mouseY; Laya.stage.on(Event.MOUSE_MOVE, this, mouseMove); } function mouseMove() { //移动地图视口 tiledMap.moveViewPort(mX - (Laya.stage.mouseX - mLastMouseX), mY - (Laya.stage.mouseY - mLastMouseY)); } function mouseUp() { mX = mX - (Laya.stage.m...

来源: Laya_示例 发布时间: 20241123

4. 区块地图-滚动地图 [ 99%]

...ya.stage.mouseX; mLastMouseY = Laya.stage.mouseY; Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.mouseMove); } mouseMove() { let moveX = mX - (Laya.stage.mouseX - mLastMouseX), moveY = mY - (Laya.stage.mouseY - mLastMouseY); // 移动地图视口 this.tiledMap.moveViewPort(moveX, moveY); } mouseUp(...

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

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

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

来源: Laya_示例 发布时间: 20241123

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

...ngth == 2) { lastDistance = 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 - ...

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

7. 鼠标交互-鼠标交互 [ 98%]

...useHandler); rect.on(Event.RIGHT_CLICK, this, mouseHandler); rect.on(Event.MOUSE_MOVE, this, mouseHandler); rect.on(Event.MOUSE_OVER, this, mouseHandler); rect.on(Event.MOUSE_OUT, this, mouseHandler); rect.on(Event.DOUBLE_CLICK, this, mouseHandler); rect.on(Event.MOUSE_WHEEL, this, mouseHandler); } ...

来源: Laya_示例 发布时间: 20241123

8. 鼠标交互-鼠标交互 [ 97%]

...ndler); rect.on(Event.RIGHT_CLICK, this, this.mouseHandler); rect.on(Event.MOUSE_MOVE, this, this.mouseHandler); rect.on(Event.MOUSE_OVER, this, this.mouseHandler); rect.on(Event.MOUSE_OUT, this, this.mouseHandler); rect.on(Event.DOUBLE_CLICK, this, this.mouseHandler); rect.on(Event.MOUSE_WHEEL, thi...

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

9. 鼠标交互-滑动 [ 97%]

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

来源: Laya_示例 发布时间: 20241123

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

...{ const Event = Laya.Event; //添加鼠标移到侦听 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.b...

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