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

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

1. 鼠标交互-鼠标交互 [ 100%]

... - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, this.mouseHandler); rect.on(Event.MOUSE_UP, this, this.mouseHandler); rect.on(Event.CLICK, this, this.mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, this.mouseHandler); rect.on(Event.RIGHT_MOUSE_UP, th...

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

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

...ALL; Laya.stage.bgColor = "#232628"; this.createMap(); Laya.stage.on(Event.MOUSE_DOWN, this, this.mouseDown); Laya.stage.on(Event.MOUSE_UP, this, this.mouseUp); Stat.show(); } // 创建地图 createMap() { const TiledMap = Laya.TiledMap, Rectangle = Laya.Rectangle, Handler = Laya.Handler, Browser = ...

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

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

...this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event = Laya.Event; // 手机上才有 touches 属性 let touches = e.touches; if (touches && touches.length == 2) { preRadian = Math.atan2( touches[0].stageY - to...

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

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

...this.sp.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.sp.on(Event.MOUSE_DOWN, this, this.onMouseDown); } onMouseDown(e) { const Event = Laya.Event; // 手机上才有 touches 属性 let touches = e.touches; if (touches && touches.length == 2) { lastDistance = this.getDistance(touches); Laya...

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

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

...ckLength) / 2; this.button.y = Laya.stage.height / 2; this.button.on(Event.MOUSE_DOWN, this, this.onMouseDown); Laya.stage.addChild(this.button); //左侧临界点设为圆形初始位置 beginPosition = this.button.x; //右侧临界点设置 endPosition = beginPosition + TrackLength; } drawTrack() ...

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

6. 文本-滚动文本 [ 93%]

...00"; this.txt.fontSize = 20; this.txt.color = "#ffffff"; this.txt.on(Event.MOUSE_DOWN, this, this.startScrollText); } /* 开始滚动文本 */ startScrollText(e) { const Event = Laya.Event; prevX = this.txt.mouseX; prevY = this.txt.mouseY; Laya.stage.on(Event.MOUSE_MOVE, this, this.scrollText); Laya...

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

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

...x(posx, posy, width, height, ratio) { var box = new Sprite(); box.on(Event.MOUSE_DOWN, this, this.mouseDown); Laya.stage.addChild(box); box.pos(posx, posy).size(width * ratio, height * ratio); var rigidbody: RigidBody = box.addComponent(RigidBody); rigidbody.category = Physics_Physics_CollisionFilte...

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

8. UI-RefreshList [ 43%]

...; } onListMouse(e, index){ console.log(e.target.name); if (e.type == Event.MOUSE_DOWN) { this.mouseDown = true; //如果单元格已经展开,则先恢复 if (this.itemIsOpen) { this.itemIsOpen = false; this.itemOpenId = -1; Tween.to(this.openedItem, { "x": 0 }, 500, null, Handler.create(this, () ...

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