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

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

201. UI运行时 · LayaAir3.3 · 引擎文档 · LAYABOX [ 72%]

...脚本,而后添加的代码如下所示: const { regClass } = Laya; import { RuntimeScriptBase } from "./RuntimeScript.generated"; @regClass() export class RuntimeScript extends RuntimeScriptBase { onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUS...

来源: Laya3.0_文档 发布时间: 20251010

202. Sprite-遮罩-放大镜 [ 72%]

....x = Laya.stage.mouseX; maskSp.y = Laya.stage.mouseY; } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class Sprite_MagnifyingGlass { private maskSp:Sprite; private bg2:Sprite;...

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

203. 屏幕适配-缩放-No Border [ 72%]

...= Laya.stage.height / 2; } } new SmartScale_Scale_NOBORDER();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOBORDER { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOBORDER; Laya.stage.bgColor = "#2...

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

204. 屏幕适配-缩放-No Scale [ 72%]

... = Laya.stage.height / 2; } } new SmartScale_Scale_NOSCALE();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_NOSCALE { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232...

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

205. 文本-字符限制 [ 72%]

...adding = [0, 4, 0, 4]; return input; } } new Text_Restrict();module laya { import Input = Laya.Input; import Stage = Laya.Stage; import Text = Laya.Text; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Text_Restrict { constructor() { // 不支持WebGL时自动切换至Canvas L...

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

206. UI-ProgressBar [ 72%]

...ole.log("进度:" + Math.floor(value * 100) + "%"); } })();module laya { import Stage = Laya.Stage; import ProgressBar = Laya.ProgressBar; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_ProgressBar { private progressBar: ProgressBar; constructor() { // 不支持WebGL时...

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

207. 区块地图-等角地图 [ 72%]

... 0, radiusY * 2, color); Laya.stage.addChild(sprite); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import MapLayer = Laya.MapLayer; import TiledMap = Laya.TiledMap; import Point = Laya.Point; import Rectangle = Laya.Rectangle; import Handler = Laya.Handler; import Web...

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

208. 文本-复杂的文本样式 [ 72%]

...ge.height - txt.textHeight) / 2; } } new Text_ComplexStyle();module laya { import Stage = Laya.Stage; import Text = Laya.Text; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Text_ComplexStyle { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.client...

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

209. UI-ComboBox [ 72%]

...g("选中了: " + cb.selectedLabel); } } new UI_ComboBox();module laya { import Stage = Laya.Stage; import ComboBox = Laya.ComboBox; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class UI_ComboBox { private skin: string = "res/ui/combobox.png"; constructor() { // 不支持WebGL...

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

210. 屏幕适配-缩放-Extract Fit [ 72%]

...aya.stage.height / 2; } } new SmartScale_Scale_EXTRACT_FIT();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; export class SmartScale_Scale_EXTRACT_FIT { private rect: Sprite; constructor() { Laya.init(550, 400); Laya.stage.scaleMode = Stage.SCALE_EXACTFIT; Laya.stage.bgColor = ...

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