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

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

1. 区块地图-滚动地图 [ 100%]

... = 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_示例 发布时间: 20241119

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

...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_示例 发布时间: 20241119

3. 鼠标交互-双指缩放(多点触控) [ 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_示例 发布时间: 20241119

4. 鼠标交互-滑动 [ 95%]

.../ 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_示例 发布时间: 20241119

5. 文本-滚动文本 [ 94%]

...crollText(e) { prevX = txt.mouseX; prevY = txt.mouseY; Laya.stage.on(Event.MOUSE_MOVE, this, scrollText); Laya.stage.on(Event.MOUSE_UP, this, finishScrollText); } /* 停止滚动文本 */ function finishScrollText(e) { Laya.stage.off(Event.MOUSE_MOVE, this, scrollText); Laya.stage.off(Event.MOUSE_UP...

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

6. 鼠标交互-鼠标交互 [ 91%]

...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_示例 发布时间: 20241119