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

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

61. UI-ColorPicker [ 80%]

...Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.loader.load(skin, Handler.create(this, this.onColorPickerSkinLoaded)); } onColorPickerSkinLoaded() { const ColorPicker = Laya.ColorPicker, Handler = Laya.Handler; let colorPicker = new ColorPicker();...

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

62. 文本-HTML文本 [ 80%]

...Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { this.createParagraph(); // 代码创建 this.showExternalHTML(); // 使用外部定义的html } createParagraph() { const HTMLDivElement = Laya.HTMLDivElement; let p = new HTMLDi...

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

63. 计时器-延迟调用 [ 80%]

...Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; demonstrate(); })(); function demonstrate() { for (var i = 0; i < 10; i++) { Laya.timer.callLater(this, onCallLater); } } function onCallLater() { console.log("onCallLater triggered"); var text = new Text...

来源: Laya_示例 发布时间: 20241118

64. 滤镜-模糊滤镜 [ 80%]

....alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load(apePath, Handler.create(this, createApe)); })(); function createApe() { var ape = new Sprite(); ape.loadImage(apePath); ape.x = (Laya.stage.width - ape.width) / 2; ape.y = (Laya.stage.hei...

来源: Laya_示例 发布时间: 20241118

65. Sprite-缓存为静态图像 [ 80%]

....alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Stat.show(); setup(); })(); function setup() { var textBox = new Sprite(); // 随机摆放文本 var text; for (var i = 0; i < 1000; i++) { text = new Text(); text.fontSize = 20; text.text = (Math.random(...

来源: Laya_示例 发布时间: 20241118

66. Sprite-旋转缩放 [ 80%]

....alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; createApe(); })(); function createApe() { ape = new Sprite(); ape.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.hei...

来源: Laya_示例 发布时间: 20241118

67. Sprite-显示图片 [ 80%]

....alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; showApe(); })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader...

来源: Laya_示例 发布时间: 20241118

68. 计时器-延迟调用 [ 80%]

...Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.demonstrate(); } demonstrate() { for (let i = 0; i < 10; i++) { Laya.timer.callLater(this, this.onCallLater); } } onCallLater() { const Text = Laya.Text; console.log("onCallLater trigger...

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

69. Sprite-缓存为静态图像 [ 80%]

...Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Laya.Stat.show(); this.cacheText(); } cacheText() { const Sprite = Laya.Sprite, Text = Laya.Text; let textBox = new Sprite(); Laya.stage.addChild(textBox); // 随机摆放文本 let text; for (let i = 0; ...

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

70. 粒子-粒子演示1 [ 79%]

....alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Stat.show(); Laya.URL.basePath += "../../"; Laya.loader.load("res/particles/GravityMode.part", Handler.create(this, onAssetsLoaded), null, Loader.JSON); })(); function onAssetsLoaded(settings) { sp = new ...

来源: Laya_示例 发布时间: 20241118