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

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

1. 显示与切换图片(JavaScript-LayaAir基础篇(JS)-位图) [ 100%]

...ER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load([texture1, texture2], Handler.create(this, onAssetsLoaded)); })(); function onAssetsLoaded() { ape = new Sprite(); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.pos(200, 200); // 显示默认纹理 switchTextur...

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

2. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 97%]

...ER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#ffffff"; Laya.loader.load([this.texture1, this.texture2], Handler.create(this, this.onAssetsLoaded)); } private onAssetsLoaded(): void { this.ape = new Sprite(); Laya.stage.addChild(this.ape); this.ape.pivot(55, 72); this.ape.pos(100,50); ...

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

3. 显示与切换图片(ActionScript-LayaAir基础篇(AS3)-位图) [ 96%]

...可以找到drawTexture()方法,除此之外,还需要了解laya.net.LoaderManager中load()方法和getRes()方法,以及laya.utils.Handler中create()方法,各方法参数图3、图4、图5、图6所示: ![图3](img/3.png) (图3) ![图4](img/4.png) (图4) ![图2](img/5.png) (图5...

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

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

...n; import laya.display.Stage; import laya.maths.Rectangle; import laya.net.Loader; import laya.utils.Browser; import laya.utils.Handler; import laya.webgl.WebGL; public class HelloLayabox { private const AniConfPath:String = "../../../../res/role.atlas"; private var roleAni:Animation; public functio...

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

5. 设置滤镜(JavaScript-LayaAir基础篇(JS)-位图) [ 91%]

...ER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load(ApePath, Handler.create(this, setup)); })(); function setup() { normalizeApe(); makeRedApe(); grayingApe(); } function normalizeApe() { var originalApe = createApe(); apeTexture = Laya.loader.getRes(ApePath); orig...

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

6. 显存优化:纹理压缩使用(TypeScript-2D进阶篇(TS)-性能优化) [ 91%]

...载纹理资源,如果要使用纹理压缩格式,则需要使用`Laya.loader.load()`来加载纹理资源。 示例代码如下所示: ```typescript //检测安卓平台 if (Laya.Browser.onAndroid) { //注意这里加载 Laya.loader.load("res/layabox.ktx", Laya.Handler.create(null, functio...

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

7. 设置滤镜(TypeScript-LayaAir基础篇(TS)-位图) [ 89%]

...ER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load(this.ApePath, Handler.create(this, this.setup)); } private setup(): void { this.normalizeApe(); this.makeRedApe(); this.grayingApe(); } private normalizeApe(): void { var originalApe: Sprite = this.createApe(); th...

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

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

...源进度进行显示,下面编码为就是错误。 1. `Laya.loader.load(urls, Laya.Handler.create(this, onAssetLoaded), Laya.Handler.create(this, onLoading));` 在上面代码中,使用`Laya.Handler.create(this,onLoading)`返回回调方法,是要处理progress加载进度事...

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

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

...源进度进行显示,下面编码为就是错误。 1. `Laya.loader.load(urls, Laya.Handler.create(this, this.onAssetLoaded), Laya.Handler.create(this, this.onLoading));` 在上面代码中,使用`Laya.Handler.create(this,this.onLoading)`返回回调方法,是要处理progress...

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

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

...度进行显示,下面编码为就是错误。 ```javascript Laya.loader.load(urls, Handler.create(this, onAssetLoaded), Handler.create(this, onLoading)); ``` 在上面代码中,使用`Handler.create(this, onLoading)`返回回调方法,是要处理progress加载进度事件,...

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