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

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

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

...帧频旋转", rotateTimeBasedText.x, rotateTimeBasedText.y + vGap); Laya.timer.loop(200, this, animateTimeBased); Laya.timer.frameLoop(2, this, animateFrameRateBased); } function createText(text, x, y) { var t = new Text(); t.text = text; t.fontSize = 30; t.color = "white"; t.bold = true; t.pivot(t...

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

2. 高级应用-闪光 [ 95%]

... new Laya.Vector3(0, 0, 0.5); var scaleDelta = 0; var scaleValue = 0; Laya.timer.frameLoop(1, this, loop); function loop() { scaleValue = Math.sin(scaleDelta += 0.01); pos1.elements[0] = pos2.elements[0] = scaleValue * 13; pos1.elements[1] = Math.sin(scaleValue * 20) * 2; pos2.elements[1] = Math.sin...

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

3. UI-ProgressBar [ 90%]

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

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

4. 骨骼动画-换装 [ 88%]

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

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

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

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

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

6. 高级应用-寻路导航 [ 62%]

...ntCount].x, this.path[this.nextPathIndex++ % this.pointCount].z); }); Laya.timer.loop(40, this, loopfun); } function loopfun() { if (this._everyPath && this.index ; private _everyPath: any; private _position: Laya.Vector3 = new Laya.Vector3(0, 0, 0); private _upVector3: Laya.Vector3 = new Laya.Vecto...

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