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

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

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

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

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

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

...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.printDirectChildren...

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

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

...ton.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.Browser; imp...

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

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

...#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/sounds/bgm.mp...

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

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

....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 Handler = Lay...

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

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

...ypeScript三种开发语言、LayaAirIDE让项目开发更高效。let hr, logger; class Network_POST { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Event = Laya.Event, Accelerator = Laya.Accelerator; // 不支持WebG...

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

7. 网络和格式-GET [ 87%]

...Script三种开发语言、LayaAirIDE让项目开发更高效。let hr, logger; class Network_GET { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Event = Laya.Event, Accelerator = Laya.Accelerator; // 不支持WebGL...

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

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

...his.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 Keyboard.R...

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

9. 屏幕适配-屏幕适配 [ 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 Sprite = La...

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

10. UI-RefreshList [ 78%]

...sStopBind(){ 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, { "x": ...

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