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

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

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

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

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

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

...e = "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(xml) { ...

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

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

...d), 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.Handler; expor...

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

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

...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, new Han...

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

5. 网络和格式-POST [ 87%]

...a.HttpRequest; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var hr, logger; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode...

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

6. 网络和格式-GET [ 86%]

...a.HttpRequest; var Browser = Laya.Browser; var WebGL = Laya.WebGL; var hr, logger; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode...

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

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

...ine.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: timeLine.play...

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

8. 屏幕适配-屏幕适配 [ 78%]

...+ 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.Spr...

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

9. UI-ColorPicker [ 74%]

...nChangeColor(colorPicker); } function onChangeColor(colorPicker) { console.log(colorPicker.selectedColor); } })();module laya { import Stage = Laya.Stage; import ColorPicker = Laya.ColorPicker; import Browser = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_C...

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

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

...a.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.stage.hei...

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