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

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

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

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

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

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

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

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

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

5. 骨骼动画-Spine事件 [ 94%]

...tX = 400, mStartY = 500, mCurrIndex = 0, mLabelSprite; class Skeleton_SpineEvent { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Sprite = Laya.Sprite; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeig...

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

6. 鼠标交互-修正交互区域 [ 94%]

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

7. 区块地图-滚动地图 [ 94%]

...() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Event = Laya.Event, Stat = Laya.Stat; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scale...

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

8. 骨骼动画-藤蔓 [ 94%]

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

9. 骨骼动画-橡胶人 [ 94%]

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

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

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