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

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

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

...ouseY = 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() { mX -= Laya.stage.mo...

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

2. 2D物理-碰撞过滤器 [ 92%]

...实现更大程度的控制 // Laya.stage.on(Event.MOUSE_MOVE, this, this.mouseMove); // Laya.stage.on(Event.MOUSE_UP, this, this.mouseUp); // Laya.stage.on(Event.MOUSE_OUT, this, this.mouseUp); // let rigidbody = this.curTarget.getComponent(RigidBody); // rigidbody.type = "kinematic"; } mouseMove(e...

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

3. 其他引擎的Demo-Example_21 [ 78%]

...imate); Laya.stage.on('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 liveGraphicsCan...

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

4. Sprite-遮罩-放大镜 [ 70%]

...Sp.pivot(50, 50); //设置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 lay...

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