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

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

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

...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

2. 精灵 · LayaAir3.0文档 · LAYABOX [ 99%]

...创建完毕,此方法只执行一次 */ 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