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

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

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

...nction setup() { createParagraph(); // 代码创建 showExternalHTML(); // 使用外部定义的html } function createParagraph() { var p = new HTMLDivElement(); Laya.stage.addChild(p); p.style.font = "Impact"; p.style.fontSize = 30; var html = "使用"; html += "HTMLDivElement"; html += "创建的"...

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

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

...ge.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.load("../../res/apes/monkey2.png", Handler.create(this, function() { va...

来源: Laya_示例 发布时间: 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); } function createCharacter(skin) { var character = new S...

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

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

...台没有任何对象,也会占用这部分内存; * 2. 销毁 Texture 使用的图片资源后,会保留 Texture 壳,当下次渲染时,发现 Texture 使用的图片资源不存在,则自动恢复。 */ var GameMain = /** @class */ (function () { function GameMain() { this.isDestroyed ...

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

5. 混合模式-Lighter [ 92%]

...ring() { bgColorChannels.r = Math.floor(bgColorChannels.r); // 绿色通道使用0 bgColorChannels.g = 0; //obj.g = Math.floor(obj.g); bgColorChannels.b = Math.floor(bgColorChannels.b); var r = bgColorChannels.r.toString(16); r = r.length == 2 ? r : "0" + r; var g = bgColorChannels.g.toString(16); g...

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

6. 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, onSelect); list.renderHandler = new Handler(this, updateItem); Laya.stage.addChild(list); // 设置数据项...

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

7. 输入设备-指南针 [ 86%]

... firstTime = false; alert("在当前设备中无法获取地球坐标系,使用设备坐标系,你可以继续观赏,但是提供的方位并非正确方位。"); } // 更新角度显示 degreesText.text = 360 - Math.floor(info.alpha) + "°"; compassImg.rotation = info.alpha; // 更新方位...

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