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

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

61. 分享:Graphics下cmds命令流的使用! [ 76%]

...es/monkey1.png','apes/monkey2.png','apes/monkey3.png'],Handler.create(this,onLoaded)); } private function onLoaded():void { //获取纹理 var texture1:Texture=Loader.getRes('apes/monkey0.png') as Texture; var texture2:Texture=Loader.getRes('apes/monkey1.png') as Texture; var texture3:Texture=Loader...

来源: Laya_社区 发布时间: 20170519

62. [LayaAirIDE3]Laya.loader.on(Event.ERROR, this, this.onError) 无法侦听到加载资源失败 [ 76%]

...gend/map.jpg"];         Laya.loader.load(urls, Laya.Loader.IMAGE, this.onLoading).then(() =>         {             this.onAssetLoaded();         });          // 侦听加载失败         Laya.loader.on(Event.ERROR, this, this.onError);     }      private onAssetLo...

来源: Laya_社区 发布时间: 20240705

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

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

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

64. 位图字体生效 [ 76%]

...(); mBitmapFont.loadFont("res/bitmapFont/test.fnt", new Laya.Handler(this, onLoaded)); function onLoaded(){ mBitmapFont.setSpaceWidth(10); Laya.Text.registerBitmapFont(mFontName,mBitmapFont); let txt = new Laya.Text(); txt.text='手机号 +86'; txt.color='#FFFFFF'; txt.font = mFontName;//===========...

来源: Laya_社区 发布时间: 20191108

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

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

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

66. 时间轴动画(JavaScript-LayaAir基础篇(JS)-动画基础) [ 75%]

...载动画所需的图集。 ```javascript //加载图集成功后,执行onLoaded回调方法 Laya.loader.load("res/atlas/ui.atlas", Laya.Handler.create(this, onLoaded)); ``` 第二步:创建Animation实例,加载动画文件 ```javascript //创建一个Animation实例 var tl = new Laya.Animati...

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

67. 图片显示好奇怪 [ 75%]

...mo() { Laya.init(800,800); Laya.loader.load('logo.png',Handler.create(this,onLoaded)); } private function onLoaded():void { var texture:Texture=Loader.getRes('logo.png'); var sp:Sprite=new Sprite(); sp.graphics.clear();//把上次的绘制清除 sp.graphics.drawTexture(texture); Laya.stage.addChild(...

来源: Laya_社区 发布时间: 20170505

68. 火狐花屏问题 [ 75%]

...,onFireFox的判断laya2去掉了, 我自己从laya1找回来; var onload = function (imageData) {                 clear();                 if (imageData) {                     var image = imageData;                     if (type !== "nativeimage") {      ...

来源: Laya_社区 发布时间: 20210629

69. UI加载完成后无法获取控件的大小——超详细版问题 [ 75%]

...l: "res/atlas/comp.json", type: Loader.ATLAS }], Handler.create(this, this.onLoaded)); function onLoaded(): void { //实例UI界面 var testUI: TestUI = new TestUI(); Laya.stage.addChild(testUI); console.log("myref-onloaded", testUI.myref.getBounds()); console.log("mypan-onloaded", testUI.mypan.getB...

来源: Laya_社区 发布时间: 20170720

70. 区块地图增加对象 [ 75%]

... Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Handler.create(this,onLoaded)); } private function onLoaded():void { var sp:Sprite=new Sprite(); sp.loadImage('bg.png'); Laya.stage.addChild(sp); }在地图加载完成的回调里去加新的显示对象,是addChild地图之上的! 2017-05-...

来源: Laya_社区 发布时间: 20170526