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

大约有 27 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 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_示例 发布时间: 20240930

2. 计时器-延迟调用 [ 99%]

...rate(); })(); function demonstrate() { for (var i = 0; i < 10; i++) { Laya.timer.callLater(this, onCallLater); } } function onCallLater() { console.log("onCallLater triggered"); var text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可...

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

3. 计时器-延迟执行 [ 93%]

...nt.CLICK, this, onDecreaseAlpha1); //定时执行一次(间隔时间) Laya.timer.once(3000, this, onComplete1); } function onDecreaseAlpha2(e) { //移除鼠标单击事件 button2.off(Event.CLICK, this, onDecreaseAlpha2); //定时执行一次(基于帧率) Laya.timer.frameOnce(60, this, onComplete2)...

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

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

5. Sprite-旋转缩放 [ 89%]

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

6. 鼠标交互-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_示例 发布时间: 20240930

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

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

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

9. 混合模式-Lighter [ 83%]

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

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

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