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

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

1. 加载-错误处理和进度 [ 100%]

..., this, onError); })(); function onAssetLoaded(texture) { // 使用texture console.log("加载结束"); } // 加载进度侦听器 function onLoading(progress) { console.log("加载进度: " + progress); } function onError(err) { console.log("加载失败: " + err); } })();module laya { import Event...

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

2. 网络和格式-XML [ 94%]

... xmlValue = "item aitem bsomethings..."; proessXML(xmlValueContainsError); console.log("\n"); proessXML(xmlValue); } function proessXML(source) { try { var xml = Utils.parseXMLFromString(source); } catch (e) { console.log(e.massage); return; } printDirectChildren(xml); } function printDirectChildren...

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

3. 加载-加载序列 [ 92%]

...setLoaded), null, null, 2, false); })(); function onAssetLoaded(texture) { console.log(texture.source); // 恢复默认并发加载个数。 if (++numLoaded == 3) { Laya.loader.maxLoader = 5; console.log("All done."); } } })();module laya { import Texture = Laya.Texture; import Handler = Laya.Handle...

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

4. 音频-播放演示 [ 91%]

...); Laya.stage.addChild(button); return button; } function onPlayMusic(e) { console.log("播放音乐"); SoundManager.playMusic("../../res/sounds/bgm.mp3", 1, new Handler(this, onComplete)); } function onPlaySound(e) { console.log("播放音效"); SoundManager.playSound("../../res/sounds/btn.mp3", 1,...

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

5. 缓动-时间线 [ 81%]

...); timeLine.on(Event.LABEL, this, this.onLabel); } function onComplete() { console.log("timeLine complete!!!!"); } function onLabel(label) { console.log("LabelName:" + label); } function keyDown(e) { switch(e.keyCode) { case Keyboard.LEFT: timeLine.play("turnLeft"); break; case Keyboard.RIGHT: timeL...

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

6. 屏幕适配-屏幕适配 [ 79%]

..." + "(" + modes[index] + ")"; } function onClick(e) { //输出坐标信息 console.log("mouse:", Laya.stage.mouseX, Laya.stage.mouseY); } function onResize() { //输出当前适配模式下的stage大小 console.log("size:", Laya.stage.width, Laya.stage.height); } })();module laya { import Sprite = ...

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

7. 计时器-延迟调用 [ 74%]

...+) { 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 = "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.s...

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

8. UI-ProgressBar [ 71%]

...ressBar.value = 0; progressBar.value += 0.05; } function onChange(value) { console.log("进度:" + Math.floor(value * 100) + "%"); } })();module laya { import Stage = Laya.Stage; import ProgressBar = Laya.ProgressBar; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_Progre...

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

9. 骨骼动画-藤蔓 [ 70%]

....ERROR, this, onError); mFactory.loadAni(mAniPath); } function onError() { console.log("error"); } function parseComplete() { //创建模式为1,可以启用换装 mArmature = mFactory.buildArmature(1); mArmature.x = mStartX; mArmature.y = mStartY; mArmature.scale(0.5, 0.5); Laya.stage.addChild(mA...

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

10. 骨骼动画-橡胶人 [ 70%]

....ERROR, this, onError); mFactory.loadAni(mAniPath); } function onError() { console.log("error"); } function parseComplete() { //创建模式为1,可以启用换装 mArmature = mFactory.buildArmature(1); mArmature.x = mStartX; mArmature.y = mStartY; //mArmature.scale(0.5, 0.5); Laya.stage.addChild(...

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