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

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

1. 图集动画(ActionScript-LayaAir基础篇(AS3)-动画基础) [ 100%]

...eAni = new Animation(); Laya.loader.load(AniConfPath, Handler.create(this, onLoaded), null, Loader.ATLAS); } private function onLoaded(_e:*=null):void { Animation.createFrames(aniUrls("die",6),"dizziness"); roleAni.play(0,true,"dizziness"); Laya.stage.addChild(roleAni); } /** * 创建一组动画的...

来源: Laya2.0_文档 发布时间: 20210715

2. 图集动画(JavaScript-LayaAir基础篇(JS)-动画基础) [ 98%]

...法 this.roleAni.loadAtlas("res/atlas/role.atlas",Laya.Handler.create(this,onLoaded)); function onLoaded(){ //添加到舞台 Laya.stage.addChild(this.roleAni); } ``` 运行代码,如图5所示。动画已加载到舞台上,默认是未播放状态的。 ![图5](img/5.png) (图5) #### 2.3 播放...

来源: Laya2.0_文档 发布时间: 20210715

3. 图集动画(TypeScript-LayaAir基础篇(TS)-动画基础) [ 98%]

...his.roleAni.loadAtlas("res/atlas/role.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //添加到舞台 Laya.stage.addChild(this.roleAni); } } new AtlasAniDemo(); ``` 运行代码,如图5所示。动画已加载到舞台上,默认是未播放状态的。 ![图5](img/5...

来源: Laya2.0_文档 发布时间: 20210715

4. 内存优化方式(JavaScript-2D进阶篇(JS)-性能优化) [ 69%]

...(urls, Laya.Handler.create(this, onAssetLoaded), Laya.Handler.create(this, onLoading));` 在上面的代码中,使用`Laya.Handler.create(this,onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress加...

来源: Laya2.0_文档 发布时间: 20210715

5. 内存优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 68%]

...a.Handler.create(this, this.onAssetLoaded), Laya.Handler.create(this, this.onLoading));` 在上面的代码中,使用`Laya.Handler.create(this,this.onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress...

来源: Laya2.0_文档 发布时间: 20210715

6. 内存优化方式(ActionScript-2D进阶篇(AS3)-性能优化) [ 67%]

...r.load(urls, Handler.create(this, onAssetLoaded), Handler.create(this, onLoading)); ``` 在上面的代码中,使用`Handler.create(this, onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress加...

来源: Laya2.0_文档 发布时间: 20210715

7. LayaAir和原生DOM交互(JavaScript-2D进阶篇(JS)-扩展模块) [ 47%]

...e.files.length) { fileReader.readAsDataURL(file.files[0]); } }; fileReader.onload = function (evt) { if (Laya.Browser.window.FileReader.DONE == fileReader.readyState) { var sp = new Laya.Sprite(); sp.loadImage(fileReader.result, 0, 0, 300, 300); Laya.stage.addChild(sp); } } ``` 编译上面的代码...

来源: Laya2.0_文档 发布时间: 20210714

8. LayaAir和原生DOM交互(TypeScript-2D进阶篇(TS)-扩展模块) [ 45%]

...le.files.length){ fileReader.readAsDataURL(file.files[0]); } }; fileReader.onload = function(evt):void { if(Laya.Browser.window.FileReader.DONE == fileReader.readyState) { var sp:Laya.Sprite = new Laya.Sprite(); sp.loadImage(fileReader.result,0,0,300,300); Laya.stage.addChild(sp); } } } } new Main; ...

来源: Laya2.0_文档 发布时间: 20210715

9. LayaAir和原生DOM交互(ActionScript-2D进阶篇(AS3)-扩展模块) [ 42%]

...]); }; var fileReader:Object = new Browser.window.FileReader(); fileReader.onload = function(evt):void { if(Browser.window.FileReader.DONE==fileReader.readyState) { var sp:Sprite = new Sprite(); sp.loadImage(fileReader.result,0,0,300,300); Laya.stage.addChild(sp); } } } } } ``` ​ 编译上面的...

来源: Laya2.0_文档 发布时间: 20210715

10. Unity插件使用说明(TypeScript-3D基础(TS)-LayaAir3D之3D场景可视化编辑) [ 23%]

...量预加载 Laya.loader.create(resource, Laya.Handler.create(this, this.onLoaded)); onLoaded(): void { //加载完成后的处理逻辑…… } ``` 使用预加载资源的示例代码如下: ```typescript //获取预加载的3D场景资源对象 var _Scene3D: Laya.Scene3D = Laya.Loader.getRes("x...

来源: Laya2.0_文档 发布时间: 20210714