大约有 10 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0047 秒)
...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
...法 this.roleAni.loadAtlas("res/atlas/role.atlas",Laya.Handler.create(this,onLoaded)); function onLoaded(){ //添加到舞台 Laya.stage.addChild(this.roleAni); } ``` 运行代码,如图5所示。动画已加载到舞台上,默认是未播放状态的。  (图5) #### 2.3 播放...
来源: Laya2.0_文档 发布时间: 20210715
...his.roleAni.loadAtlas("res/atlas/role.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //添加到舞台 Laya.stage.addChild(this.roleAni); } } new AtlasAniDemo(); ``` 运行代码,如图5所示。动画已加载到舞台上,默认是未播放状态的。 , Laya.Handler.create(this, onLoading));` 在上面的代码中,使用`Laya.Handler.create(this,onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress加...
来源: Laya2.0_文档 发布时间: 20210715
...a.Handler.create(this, this.onAssetLoaded), Laya.Handler.create(this, this.onLoading));` 在上面的代码中,使用`Laya.Handler.create(this,this.onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress...
来源: Laya2.0_文档 发布时间: 20210715
...r.load(urls, Handler.create(this, onAssetLoaded), Handler.create(this, onLoading)); ``` 在上面的代码中,使用`Handler.create(this, onLoading)`返回的回调方法,是要处理progress加载进度事件,由于回调执行一次之后就被对象池回收了,所以,progress加...
来源: Laya2.0_文档 发布时间: 20210715
...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
...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
...]); }; 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
...量预加载 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