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

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

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

...edText.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.width / 2, t.height / 2); t.pos(x, y); Laya.stage....

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

2. Sprite-旋转缩放 [ 92%]

...); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; Laya.timer.frameLoop(1, this, animate); } function animate(e) { ape.rotation += 2; //心跳缩放 scaleDelta += 0.02; var scaleValue = Math.sin(scaleDelta); ape.scale(scaleValue, scaleValue); } })();module laya { import Sprite = Laya.Sp...

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

3. 性能测试-虫子(慎入) [ 90%]

...maggotTexture = Laya.loader.getRes(texturePath); initMaggots(); Laya.timer.frameLoop(1, this, animate); } function initMaggots() { var maggotContainer; for (var i = 0; i wb.x + wb.width) x -= wb.width; if (y wb.y + wb.height) y -= wb.height; maggot.pos(x, y); } tick += 0.1; } })();module laya { impo...

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

4. Sprite-容器 [ 90%]

...e); } apesCtn.pos(Laya.stage.width / 2, Laya.stage.height / 2); Laya.timer.frameLoop(1, this, animate); } function animate(e) { apesCtn.rotation += 1; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browser; import WebGL =...

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

5. Sprite-节点控制 [ 89%]

...猩猩的子级 Laya.stage.addChild(ape1); ape1.addChild(ape2); Laya.timer.frameLoop(1, this, animate); } function animate(e) { ape1.rotation += 2; ape2.rotation -= 4; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browse...

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

6. Sprite-轴心点 [ 89%]

...h + gap) / 2, Laya.stage.height / 2); Laya.stage.addChild(sp2); Laya.timer.frameLoop(1, this, animate); } function animate(e) { sp1.rotation += 2; sp2.rotation += 2; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browser;...

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

7. 鼠标交互-键盘交互 [ 88%]

...p(); })(); function setup() { listenKeyboard(); createLogger(); Laya.timer.frameLoop(1, this, keyboardInspector); } function listenKeyboard() { keyDownList = []; //添加键盘按下事件,一直按着某按键则会不断触发 Laya.stage.on(Event.KEY_DOWN, this, onKeyDown); //添加键盘抬起事...

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

8. VR场景-VR地球 [ 87%]

...era.sky = skyBox; var rotation = new Laya.Vector3(0, 0.002, 0); Laya.timer.frameLoop(1, null, function() { earth.transform.rotate(rotation, true); });class VRScene1 { private rotation: Laya.Vector3; constructor() { Laya3D.init(0, 0, true); Laya.stage.scaleMode = Laya.Stage.SCALE_FULL; Laya.stage.scr...

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

9. 其他引擎的Demo-Example_21 [ 86%]

...ight, WebGL); Laya.stage.bgColor = "#3da8bb"; createCanvases(); Laya.timer.frameLoop(1, this, animate); Laya.stage.on('mousedown', this, onMouseDown); Laya.stage.on('mousemove', this, onMouseMove); Laya.stage.on('mouseup', this, onMouseUp); })(); function createCanvases() { var graphicsCanvas = new ...

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

10. 材质-BlinnPhong材质加载 [ 84%]

...rm.rotation = new Laya.Quaternion(0.7071068, 0, 0, -0.7071067); Laya.timer.frameLoop(1, this, function () { layaMonkey.transform.rotate(this.rotation, false); });class BlinnPhongMaterialLoad { private rotation:Laya.Vector3 = new Laya.Vector3(0, 0.01, 0); constructor() { Laya3D.init(0, 0, true); Laya...

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