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

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

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

2. Sprite3D-Sprite3D变换 [ 92%]

....instantiate(layaMonkey1, null, false, new Laya.Vector3(0.6, 0, 0))); Laya.timer.frameLoop(1, this, animate); } var _position = new Laya.Vector3(-0.6, 0, 0); var _rotate = new Laya.Vector3(0, 1, 0); var _scale = new Laya.Vector3(); var scaleDelta = 0; var scaleValue = 0; function animate() { scaleVa...

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

3. Sprite-旋转缩放 [ 90%]

...55, 72); 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 = L...

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

4. 鼠标交互-Hold [ 89%]

...n onApePress(e) { // 鼠标按下后,HOLD_TRIGGER_TIME毫秒后hold Laya.timer.once(HOLD_TRIGGER_TIME, this, onHold); Laya.stage.on(Event.MOUSE_UP, this, onApeRelease); } function onHold() { Tween.to(ape, { "scaleX": 1, "scaleY": 1 }, 500, Ease.bounceOut); isApeHold = true; } /** 鼠标放开后...

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

5. UI-ProgressBar [ 87%]

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

6. VR场景-VR地球 [ 85%]

... vrCamera.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.sta...

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

7. 混合模式-Lighter [ 84%]

...ion setup() { createPhoenixes(); // 动态背景渲染 evalBgColor(); Laya.timer.frameLoop(1, this, renderBg); } function createPhoenixes() { var scaleFactor = Math.min( Laya.stage.width / (phoenixWidth * 2), Laya.stage.height / phoenixHeight); // 加了混合模式的凤凰 var blendedPhoenix = cre...

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

8. 材质-BlinnPhong材质加载 [ 82%]

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

9. 高级应用-闪光 [ 82%]

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

10. 灯光-方向光 [ 80%]

...play(null, 1.0, 40, 70); }); var _quaternion = new Laya.Quaternion(); Laya.timer.frameLoop(1, null, function () { Laya.Quaternion.createFromYawPitchRoll(0.025, 0, 0, _quaternion); var _direction = directionLight.direction; Laya.Vector3.transformQuat(_direction, _quaternion, _direction); directionLig...

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