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

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

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

...ches[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].stageX); sp.rotation...

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

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

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

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

...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 - lastDistance) * factor; ...

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

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

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

...Down(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.max(Math.min(Laya.s...

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

6. Sprite-遮罩-放大镜 [ 96%]

...(50, 50); //设置mask bg2.mask = maskSp; Laya.stage.on("mousemove", this, onMouseMove); } function onMouseMove() { bg2.x = -Laya.stage.mouseX * 2; bg2.y = -Laya.stage.mouseY * 2; maskSp.x = Laya.stage.mouseX; maskSp.y = Laya.stage.mouseY; } })();module laya { import Sprite = Laya.Sprite; import Sta...

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

7. 鼠标交互-滑动 [ 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_示例 发布时间: 20241117

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

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

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

9. 其他引擎的Demo-Example_21 [ 94%]

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

10. Sprite-遮罩-放大镜 [ 87%]

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