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

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

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

...eractiveTarget(); this.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.st...

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

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

... 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, h = 300; this.sp = new Sprite(); Laya.stage.addChild...

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

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

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; 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 = 30...

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

4. 鼠标交互-滑动 [ 97%]

...Sprite(); 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, "#FF7F50"); this.button.pivot(w / 2, h / 2); //设置宽高(要接收鼠标事件必须设置宽高,否...

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

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

...s.createHouse(); 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); // L...

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

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

...r = "#232628"; this.createText(); } createText() { const Text = Laya.Text, Event = Laya.Event; this.txt = new Text(); Laya.stage.addChild(this.txt); this.txt.overflow = Text.SCROLL; this.txt.text = "Layabox是HTML5引擎技术提供商与优秀的游戏发行商,面向AS/JS/TS开发者提供HTML5...

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

7. 计时器-延迟执行 [ 96%]

...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Event = Laya.Event; let vGap = 100; this.button1 = this.createButton("点我3秒之后 alpha - 0.5"); this.button1.x = (Laya.stage.width - this.button1.width) / 2; this.button1.y = (Laya.stage.height - this.button1.height - v...

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

8. 鼠标交互-修正交互区域 [ 96%]

...} setup() { this.buildWorld(); this.createLogger(); } buildWorld() { const Event = Laya.Event; this.createCoralRect(); this.createDeepSkyblueRect(); this.createDarkOrchidRect(); // 设置舞台 Laya.stage.name = "暗灰色舞台" Laya.stage.on(Event.MOUSE_DOWN, this, this.onDown); } createCoralRect(...

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

9. 骨骼动画-藤蔓 [ 95%]

...Stat.show(); this.startFun(); } startFun() { const Templet = Laya.Templet, Event = Laya.Event; const mAniPath = "res/spine/spineRes5/vine.sk"; mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, this.parseComplete); mFactory.on(Event.ERROR, this, this.onError); mFactory.loadAni(mAniPath); } ...

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

10. 骨骼动画-橡胶人 [ 95%]

...Stat.show(); this.startFun(); } startFun() { const Templet = Laya.Templet, Event = Laya.Event; const mAniPath = "res/spine/spineRes4/stretchyman.sk"; mFactory = new Templet(); mFactory.on(Event.COMPLETE, this, this.parseComplete); mFactory.on(Event.ERROR, this, this.onError); mFactory.loadAni(mAniPa...

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