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

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

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

...e(); for (let i = 1; i mouseJoint).onMouseDown); Laya.stage.on(Event.MOUSE_UP, this, this.destoryJoint); Laya.stage.on(Event.MOUSE_OUT, this, this.destoryJoint); // 方案二,自己实现,可以实现更大程度的控制 // Laya.stage.on(Event.MOUSE_MOVE, this, this.mouseMove); // Laya.stage.on...

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

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

... Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createInteractiveTarget(); this.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); ...

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

3. UI-ScrollBar [ 94%]

...png", "res/ui/hscroll$bar.png", "res/ui/hscroll$down.png", "res/ui/hscroll$up.png"); skins.push("res/ui/vscroll.png", "res/ui/vscroll$bar.png", "res/ui/vscroll$down.png", "res/ui/vscroll$up.png"); Laya.loader.load(skins, Handler.create(this, this.onSkinLoadComplete)); } onSkinLoadComplete() { this.p...

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

4. 鼠标交互-Hold [ 91%]

...imer.once(HOLD_TRIGGER_TIME, this, this.onHold); Laya.stage.on(Event.MOUSE_UP, this, this.onApeRelease); } onHold() { const Tween = Laya.Tween, Ease = Laya.Ease; Tween.to(this.ape, { "scaleX": 1, "scaleY": 1 }, 500, Ease.bounceOut); isApeHold = true; } /** 鼠标放开后停止hold */ onApeRelease()...

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

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

... Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createSprite(); this.drawTrack(); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; const w = 50; const h = 30; this.button = new Sprite(); this.button.graphics.drawRect(0, 0, w, h, "#F...

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

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

...age.on(Event.MOUSE_MOVE, this, this.scrollText); Laya.stage.on(Event.MOUSE_UP, this, this.finishScrollText); } /* 停止滚动文本 */ finishScrollText(e) { const Event = Laya.Event; Laya.stage.off(Event.MOUSE_MOVE, this, this.scrollText); Laya.stage.off(Event.MOUSE_UP, this, this.finishScrollText)...

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

7. 鼠标交互-键盘交互 [ 79%]

... Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.listenKeyboard(); this.createLogger(); Laya.timer.frameLoop(1, this, this.keyboardInspector); } listenKeyboard() { const Event = Laya.Event; // 用Set实现更好一些 keyDownList = []; // 添加键盘...

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

8. 区块地图-滚动地图 [ 75%]

...tage.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 = Laya.Browser; mX = mY = 0; // 创建地图对象 this.tiledMa...

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

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

... Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createSprite(); Laya.stage.on(Event.MOUSE_UP, this, this.onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, this.onMouseUp); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; let w = 200,...

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

10. 缓动-时间线 [ 74%]

... Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; this.createApe(); this.createTimerLine(); Laya.stage.on(Event.KEY_DOWN, this, this.keyDown); } createApe() { const Sprite = Laya.Sprite; this.target = new Sprite(); Laya.stage.addCh...

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