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

大约有 28 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0049 秒)

1. 使用百度地图 · LayaAir3.4 · 引擎文档 · LAYABOX [ 100%]

...Geolocation.enableHighAccuracy = true; Laya.Geolocation.watchPosition(Laya.Handler.create(this, this.updatePosition), Laya.Handler.create(this, this.onError)); // 绑定convertToBaiduCoord作用域 this.convertToBaiduCoord = this.convertToBaiduCoord.bind(this); } } 由于本例不需要使用LayaAir...

来源: Laya3.0_文档 发布时间: 20251010

2. 取色器组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 97%]

...colorPicker.skin = this.skin; colorPicker.pos(100, 100); colorPicker.changeHandler = new Laya.Handler(this, this.onChangeColor, [colorPicker]); this.owner.addChild(colorPicker); this.onChangeColor(colorPicker); } private onChangeColor(colorPicker: Laya.ColorPicker, e: any = null): void { console.log...

来源: Laya3.0_文档 发布时间: 20251010

3. 垂直滑动条组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 93%]

...图片资源来自“引擎API使用示例” Laya.loader.load(skins, Laya.Handler.create(this, this.placeVSlider)); } private placeVSlider(): void { let vs: Laya.Slider = new Laya.VSlider(); vs.skin = "vslider.png"; vs.height = 300; vs.pos(400, 50); vs.min = 0; vs.max = 100; vs.value = 50; vs.tick ...

来源: Laya3.0_文档 发布时间: 20251010

4. 水平滑动条组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 93%]

...图片资源来自“引擎API使用示例” Laya.loader.load(skins, Laya.Handler.create(this, this.placeHSlider)); } private placeHSlider(): void { let hs: Laya.Slider = new Laya.HSlider(); hs.skin = "hslider.png"; hs.width = 300; hs.pos(50, 500); hs.min = 0; hs.max = 100; hs.value = 50; hs.tick =...

来源: Laya3.0_文档 发布时间: 20251010

5. 进度条组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 88%]

...width = 400; this.progressBar.sizeGrid = "5,5,5,5"; this.progressBar.changeHandler = new Laya.Handler(this, this.onChange); this.owner.addChild(this.progressBar); Laya.timer.loop(100, this, this.changeValue); }); } // 模拟进度条加载 private changeValue(): void { if (this.progressBar.value &gt...

来源: Laya3.0_文档 发布时间: 20251010

6. TiledMap地图 · LayaAir3.4 · 引擎文档 · LAYABOX [ 86%]

...is.tMap.createMap("resources/TiledMap/orthogonal.json", viewRect, new Laya.Handler(this, this.completeHandler)); } //添加地图到Scene2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHa...

来源: Laya3.0_文档 发布时间: 20251010

7. 列表组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 86%]

...nce = 50; // 设置是否可以选中 list.selectEnable = true; list.selectHandler = new Laya.Handler(this, this.onSelect); // 单元格渲染处理 list.renderHandler = new Laya.Handler(this, this.updateItem); this.owner.addChild(list); // 设置数据源为对应图片的路径 var data: any[] = [...

来源: Laya3.0_文档 发布时间: 20251010

8. 二次开发 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

...etString( "value" )); } catch (JSONException e) { e.printStackTrace(); } m_Handler.post( new Runnable() { public void run() { //ui thread update ui JSONObject obj = new JSONObject(); try { obj.put("value", "Hello JS!"); } catch (JSONException e) { e.printStackTrace(); } ExportJavaFunction.CallBackTo...

来源: Laya3.0_文档 发布时间: 20250422

9. 导航容器组件 · LayaAir3.4 · 引擎文档 · LAYABOX [ 82%]

...一次 onAwake(): void { //点击Tab选择按钮的处理 this.tab.selectHandler = new Laya.Handler(this, this.onSelecte); } // 根据选择tab的索引切换页面 private onSelecte(index: number): void { //切换ViewStack子页面 this.viewstack.selectedIndex = index; } } 最终的效果如动图1...

来源: Laya3.0_文档 发布时间: 20251010

10. 多线程Worker · LayaAir3.4 · 引擎文档 · LAYABOX [ 81%]

... //加载引擎需要的资源 Laya.loader.load("../atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; WorkerLoader.workerPath = "libs...

来源: Laya3.0_文档 发布时间: 20251010