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

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

1. 精灵 · LayaAir3.0文档 · LAYABOX [ 100%]

...创建完毕,此方法只执行一次 */ onAwake(): void { this.sprite.loadImage("atlas/comp/image.png"); //纹理:图片路径 this.sprite.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置:屏幕中心 this.sprite.x = Laya.stage.width/2; //x、y分别设置位置 this.s...

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

2. 2D性能优化 · LayaAir3.0文档 · LAYABOX [ 85%]

...oSize是不可取的。如果设置了size,autoSize将不起效。 使用loadImage后获取宽高: var sp=new Laya.Sprite(); sp.loadImage("res/apes/monkey2.png",0,0,0,0,Laya.Handler.create(this,function() { console.log(sp.width,sp.height); })); Laya.stage.addChild(sp); loadImage在加载完成...

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

3. 使用二进制图片 · LayaAir3.0文档 · LAYABOX [ 80%]

...= (e)=> { let sp1:Sprite = new Sprite(); //加载Base64图片数据 sp1.loadImage(e.target.result as string); this.owner.addChild(sp1); } }); 上述代码中,用 Laya.loader.fetch 加载图片二进制数据,根据自定义的规则,可以解析数据加密方式,并获得完整图片数...

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