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

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

1. 加载-单一类型资源加载 [ 100%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Loader_SingleType { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Brows...

来源: Laya2.0_示例 发布时间: 20241118

2. 加载-多种类型资源加载 [ 98%]

...种开发语言、LayaAirIDE让项目开发更高效。(function() { var Loader = Laya.Loader; var Handler = Laya.Handler; var ROBOT_DATA_PATH = "res/skeleton/robot/robot.bin"; var ROBOT_TEXTURE_PATH = "res/skeleton/robot/texture.png"; (function() { Laya.init(100, 100); var assets = []; assets.push(...

来源: Laya2.0_示例 发布时间: 20241118

3. 性能测试-骨骼 [ 93%]

... Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Loader = Laya.Loader; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCA...

来源: Laya2.0_示例 发布时间: 20241118

4. Sprite-切换纹理 [ 85%]

...tage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.flag = true; Laya.loader.load([monkey1Str, monkey2Str], Laya.Handler.create(this, this.onAssetsLoaded)); } onAssetsLoaded() { monkey1Res = Laya.loader.getRes(monkey1Str), monkey2Res = Laya.loader.getRes(monkey2Str); this.ape = new Laya.Sprite(...

来源: Laya2.0_示例 发布时间: 20241118

5. 滤镜-发光滤镜 [ 83%]

...tage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(apePath, Laya.Handler.create(this, this.setup)); } setup() { this.createApe(); this.applayFilter(); } createApe() { const Sprite = Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture =...

来源: Laya2.0_示例 发布时间: 20241118

6. Sprite-显示图片 [ 83%]

...hild(ape); ape.loadImage(monkey1Path); // 方法2:使用drawTexture Laya.loader.load(monkey2Path, Laya.Handler.create(this, function () { let monkey2 = Laya.loader.getRes(monkey2Path); let ape2 = new Laya.Sprite(); Laya.stage.addChild(ape2); ape2.graphics.drawTexture(monkey2, 100, 0); })); } } new...

来源: Laya2.0_示例 发布时间: 20241118

7. 性能测试-虫子(慎入) [ 82%]

...ng, Laya.stage.width + padding * 2, Laya.stage.height + padding * 2); Laya.loader.load(texturePath, Handler.create(this, this.onTextureLoaded)); } onTextureLoaded() { maggotTexture = Laya.loader.getRes(texturePath); this.initMaggots(); Laya.timer.frameLoop(1, this, this.animate); } initMaggots() { l...

来源: Laya2.0_示例 发布时间: 20241118

8. 滤镜-颜色滤镜 [ 79%]

...tage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(apePath, Laya.Handler.create(this, this.setup)); } setup() { this.normalizeApe(); this.makeRedApe(); this.grayingApe(); } normalizeApe() { let originalApe = this.createApe(); originalApe.x = (Laya.stage.width - ap...

来源: Laya2.0_示例 发布时间: 20241118

9. 鼠标交互-拖动 [ 78%]

...e = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); Laya.loader.load(ApePath, Handler.create(this, this.setup)); } setup() { this.createApe(); this.showDragRegion(); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(ApePath)...

来源: Laya2.0_示例 发布时间: 20241118

10. 鼠标交互-Hold [ 75%]

...e = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); Laya.loader.load(apePath, Handler.create(this, this.createApe)); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(apePath); let texture = Laya.loader.getRes(apePath); this...

来源: Laya2.0_示例 发布时间: 20241118