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

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

1. 组件装饰器说明 · LayaAir3.3 · 引擎文档 · LAYABOX [ 100%]

...{ regClass, property } = Laya; @regClass() class Animal { private _weight: number = 0; @property( { type : Number } ) get weight() : number { return this._weight; } //如果没有 Setter,则 weight 为只读属性 set weight(value: number) { this._weight = value; } } 2.3 是否序列化保存 seri...

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

2. 资源加载 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...s/monkey2.png"); } /**加载并显示图片 */ loadTexture(url: string, x: number = 0, y: number = 0): void { Laya.loader.load(url).then((res: Laya.Texture) => { let img = new Laya.Image(); img.texture = res; // img.skin = url; //ui组件直接设置skin也可以 img.pos(x, y); this.owner.addChil...

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

3. 浏览器接口 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...果前者为0或为空,则选择后者。 */ static get clientWidth(): number { Browser.__init__(); return Browser._clientWidth || Browser._window.innerWidth || Browser._document.body.clientWidth; } static set clientWidth(value: number) { Browser._clientWidth = value; } /** * 浏览器窗口可视...

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

4. 列表组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 91%]

...void { // 给List对象赋值 var data: Array<any> = []; for (var m: number = 0; m < 20; m++) { data.push({ m_label: "No." + m }); } this.list.array = data; } } 代码中,m_label的命名要与List列表项下的Label组件命名相同。 1.2.5 运行查看效果 将脚本挂载到Scene2D...

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

5. 2D网格渲染器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 86%]

...,段数越多圆越平滑 */ private generateCircleVerticesAndUV(radius: number, numSegments: number): Laya.Mesh2D { // 2π const twoPi = Math.PI * 2; // 顶点数组 let vertexs = new Float32Array((numSegments + 1) * 5); // 索引数组 let index = new Uint16Array((numSegments + 1) * 3); var pos ...

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

6. 输入文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 86%]

... 输入框类型,共有十三种类型:text、password、email、url、number、range、date、month、week、time、dateime、dateime—local、search。效果等同HTML的input 字符数量限制 maxchars 最大字符数,默认为100000。设置字符数量限制时,小于等于0的值将...

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

7. 2D精灵光 · LayaAir3.3 · 引擎文档 · LAYABOX [ 86%]

...e = true; } // 生成一个矩形 private generateRectVerticesAndUV(width: number, height: number): Laya.Mesh2D { const vertices = new Float32Array(4 * 5); const indices = new Uint16Array(2 * 3); let index = 0; vertices[index++] = 0; vertices[index++] = 0; vertices[index++] = 0; vertices[index++] = ...

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

8. UI弹窗 · LayaAir3.0文档 · LAYABOX [ 86%]

...Class() export class UI_Dialog extends Laya.Script { private DIALOG_WIDTH: number = 220; private DIALOG_HEIGHT: number = 275; private CLOSE_BTN_WIDTH: number = 43; private CLOSE_BTN_PADDING: number = 5; private assets: any[]; private dialog: Laya.Dialog; constructor() { super(); } /** * 组件被激...

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

9. 事件管理 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

...og("Game Start"); this.Tab.selectHandler = Laya.Handler.create(this,(index:number)=>{ console.log(index); }) } Tab会侦听用户点了某个标签,并从对象池创建一个处理器。 ​ 2,clear(): Handler 清理对象引用 this.Tab.selectHandler.clear(); ​ 3,recover(): void 清理...

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

10. 滑动条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 84%]

...缩条底边缘固定,进度越大,伸缩条越往上延伸。 Whole Numbers 勾选后,当滑动条被用户滑动时,最后只会停止在整数位置上,也就是滑动条的值始终是整数。这个功能可用于实现分级的滑动条。 Change On Click 勾选后,直接点击滑...

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