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

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

1. MOUSE_DOWNMOUSE_UP,CLICK [ 100%]

MOUSE_DOWNMOUSE_UP,CLICK 三个鼠标事件,实现按下,松开,对象缩小和放大,点击事件打开对应界面。 问题:鼠标按下后,移开之后再松开。MOUSE_UP和CLICK都没有触发。导致对象缩小了却没有回归到正常状态。如何解决这问题呢? 2...

来源: Laya_社区 发布时间: 20180414

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

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

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

3. 鼠标交互-鼠标交互 [ 85%]

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

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

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

5. 为对象创建Laya.Event.MOUSE_UPLaya.Event.CLICK 事件的问题,, [ 84%]

...多游戏里面都需要的,, 阿呆 • 2020-09-22 21:34 mouse_move和mouse_down 也可以用这方法吗?

来源: Laya_社区 发布时间: 20180111

6. 鼠标交互-Hold [ 84%]

....8, 0.8); Laya.stage.addChild(this.ape); // 鼠标交互 this.ape.on(Event.MOUSE_DOWN, this, this.onApePress); } onApePress(e) { const Event = Laya.Event; // 鼠标按下后,HOLD_TRIGGER_TIME毫秒后hold Laya.timer.once(HOLD_TRIGGER_TIME, this, this.onHold); Laya.stage.on(Event.MOUSE_UP, this, th...

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

7. 鼠标交互-Hold [ 84%]

...pe.scale(0.8, 0.8); Laya.stage.addChild(ape); // 鼠标交互 ape.on(Event.MOUSE_DOWN, this, onApePress); } function onApePress(e) { // 鼠标按下后,HOLD_TRIGGER_TIME毫秒后hold Laya.timer.once(HOLD_TRIGGER_TIME, this, onHold); Laya.stage.on(Event.MOUSE_UP, this, onApeRelease); } function onH...

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

8. 鼠标交互-滑动 [ 81%]

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

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

9. 鼠标交互-滑动 [ 81%]

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

10. 文本-滚动文本 [ 80%]

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

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