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

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

1. 文本-HTML文本 [ 100%]

...up() { this.createParagraph(); // 代码创建 this.showExternalHTML(); // 使用外部定义的html } createParagraph() { const HTMLDivElement = Laya.HTMLDivElement; let p = new HTMLDivElement(); Laya.stage.addChild(p); p.style.font = "Impact"; p.style.fontSize = 30; let html = "使用"; html += "H...

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

2. Sprite-显示图片 [ 99%]

...es/apes/monkey1.png", monkey2Path = "./res/apes/monkey2.png"; // 方法1:使用loadImage let ape = new Laya.Sprite(); Laya.stage.addChild(ape); ape.loadImage(monkey1Path); // 方法2:使用drawTexture Laya.loader.load(monkey2Path, Laya.Handler.create(this, function () { let monkey2 = Laya.loader...

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

3. 缓动-简单的Tween [ 99%]

...wLine(terminalX, 0, terminalX, Laya.stage.height, "#FFFFFF"); // characterA使用Tween.to缓动 Tween.to(characterA, { x : terminalX }, 1000); // characterB使用Tween.from缓动 characterB.x = terminalX; Tween.from(characterB, { x:0 }, 1000); } createCharacter(skin) { const Sprite = Laya.Sprite; le...

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

4. 加载-销毁Texture使用的图片资源 [ 94%]

... this.spBg.visible = false; this.aniFly.visible = false; //销毁 Texture 使用的图片资源 Laya.loader.clearTextureRes(PathBg); Laya.loader.clearTextureRes(PathFly); this.isDestroyed = true; this.txt.text = "恢复"; } } } new Loader_ClearTextureRes();namespace leo { import Sprite = laya.displa...

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

5. 骨骼动画-多纹理 [ 93%]

...); } onError() { trace("error"); } parseComplete() { // 创建模式为1,使用动画自己的缓冲区,可以启用换装(相当耗费内存) mArmature = mFactory.buildArmature(1); Laya.stage.addChild(mArmature); mArmature.pos(mStartX, mStartY); mArmature.scale(0.5, 0.5); mArmature.on(Laya.Even...

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

6. 骨骼动画-藤蔓 [ 93%]

...ror"); } parseComplete() { const Event = Laya.Event; // 创建模式为1,使用动画自己的缓冲区,可以启用换装(相当耗费内存) mArmature = mFactory.buildArmature(1); Laya.stage.addChild(mArmature); mArmature.pos(mStartX, mStartY); mArmature.scale(0.5, 0.5); mArmature.on(Event.STO...

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

7. 骨骼动画-橡胶人 [ 93%]

...ror"); } parseComplete() { const Event = Laya.Event; // 创建模式为1,使用动画自己的缓冲区,可以启用换装(相当耗费内存) mArmature = mFactory.buildArmature(1); Laya.stage.addChild(mArmature); mArmature.pos(mStartX, mStartY); // mArmature.scale(0.5, 0.5); mArmature.on(Event....

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

8. 混合模式-Lighter [ 93%]

...nimation(); blendedPhoenix.blendMode = Laya.BlendMode.LIGHTER; // 指定要使用的混合模式 blendedPhoenix.scale(scaleFactor, scaleFactor); blendedPhoenix.y = (Laya.stage.height - phoenixHeight * scaleFactor) / 2; // 正常模式的凤凰 let normalPhoenix = this.createAnimation(); normalPhoeni...

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

9. 骨骼动画-换装 [ 92%]

...ror"); } parseComplete() { const Event = Laya.Event; // 创建模式为1,使用动画自己的缓冲区,可以启用换装(相当耗费内存) mArmature = mFactory.buildArmature(1); Laya.stage.addChild(mArmature); mArmature.pos(mStartX, mStartY); // mArmature.scale(0.5, 0.5); mArmature.on(Event....

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

10. UI-List [ 92%]

...idth - WID) / 2; list.y = (Laya.stage.height - HEI * list.repeatY) / 2; // 使用但隐藏滚动条 list.vScrollBarSkin = ""; list.selectEnable = true; list.selectHandler = new Handler(this, this.onSelect); list.renderHandler = new Handler(this, this.updateItem); // 设置数据项为对应图片的...

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