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

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

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

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

来源: Laya2.0_示例 发布时间: 20240930

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

...alue = "item aitem bsomethings..."; this.proessXML(xmlValueContainsError); console.log("\n"); this.proessXML(xmlValue); } // 使用xml proessXML(source) { const Utils = Laya.Utils; let xml; try { xml = Utils.parseXMLFromString(source); } catch (e) { console.log(e.massage); return; } this.printDirect...

来源: Laya2.0_示例 发布时间: 20240930

3. 骨骼动画-适配版Spine [ 93%]

...is.skeleton.on(Event.STOPPED, this, this.play); this.play(); } onError() { console.log("parse error"); } play() { console.log("1111111111"); if (++this.index >= this.skeleton.getAnimNum()) { this.index = 0; } this.skeleton.play(this.index, false, true); } } new SpineBinary;import Browser = Laya.Brow...

来源: Laya2.0_示例 发布时间: 20240930

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

...mHei", "#FFFFFF", "center"); return btn; } // 播放音效 onPlaySound() { console.log("播放音效"); Laya.SoundManager.playSound("res/sounds/btn.mp3", 1, new Laya.Handler(this, this.onComplete)); } // 播放音乐 onPlayMusic() { console.log("播放音乐"); Laya.SoundManager.playMusic("res/sound...

来源: Laya2.0_示例 发布时间: 20240930

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

...is, this.onAssetLoaded), null, null, 2, false); } onAssetLoaded(texture) { console.log(texture.url); // 恢复默认并发加载个数。 if (++numLoaded == 3) { Laya.loader.maxLoader = 5; console.log("All done."); } } } new Loader_Sequence();module laya { import Texture = Laya.Texture; import Handl...

来源: Laya2.0_示例 发布时间: 20240930

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

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

来源: Laya2.0_示例 发布时间: 20240930

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

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

来源: Laya2.0_示例 发布时间: 20240930

8. UI-RefreshList [ 79%]

...rollBarIsStopBind(){ return this.scrollBarIsStop; } onListMouse(e, index){ console.log(e.target.name); if (e.type == Event.MOUSE_DOWN) { this.mouseDown = true; //如果单元格已经展开,则先恢复 if (this.itemIsOpen) { this.itemIsOpen = false; this.itemOpenId = -1; Tween.to(this.openedItem,...

来源: Laya2.0_示例 发布时间: 20240930

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

...Later(this, this.onCallLater); } } onCallLater() { const Text = Laya.Text; console.log("onCallLater triggered"); let text = new Text(); text.font = "SimHei"; text.fontSize = 30; text.color = "#FFFFFF"; text.text = "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.s...

来源: Laya2.0_示例 发布时间: 20240930

10. UI-ProgressBar [ 71%]

...ogressBar.value = 0; } this.progressBar.value += 0.05; } onChange(value) { console.log("进度:" + Math.floor(value * 100) + "%"); } } new UI_ProgressBar();module laya { import Stage = Laya.Stage; import ProgressBar = Laya.ProgressBar; import Handler = Laya.Handler; import WebGL = Laya.WebGL; expo...

来源: Laya2.0_示例 发布时间: 20240930