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

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

1. 计时器-间隔循环 [ 100%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Timer_Interval { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height...

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

2. UI-ProgressBar [ 92%]

..."; this.progressBar.changeHandler = new Handler(this, this.onChange); Laya.timer.loop(100, this, this.changeValue); } changeValue() { if (this.progressBar.value >= 1) { this.progressBar.value = 0; } this.progressBar.value += 0.05; } onChange(value) { console.log("进度:" + Math.floor(value * 100)...

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

3. 骨骼动画-换装 [ 90%]

...STOPPED, this, this.completeHandler); this.play(); this.changeSkin(); Laya.timer.loop(1000, this, this.changeSkin); } changeSkin() { mCurrSkinIndex++; let skinLength = mSkinList.length; if (mCurrSkinIndex >= skinLength) { mCurrSkinIndex = 0; } mArmature.showSkinByName(mSkinList[mCurrSkinIndex]); } c...

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

4. 输入设备-贪吃蛇(重力感应) [ 86%]

...ance.on(Event.CHANGE, this, this.monitorAccelerator); // 游戏循环 Laya.timer.frameLoop(1, this, this.animate); // 食物生产 Laya.timer.loop(3000, this, this.produceFood); // 游戏开始时有一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let...

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

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

...var mouseJoint: MouseJoint = this.curTarget.addComponent(MouseJoint); Laya.timer.callLater(mouseJoint, mouseJoint.onMouseDown); Laya.stage.on(Event.MOUSE_UP, this, this.destoryJoint); Laya.stage.on(Event.MOUSE_OUT, this, this.destoryJoint); // 方案二,自己实现,可以实现更大程度的...

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