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

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

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

...需要显示Tips或属性的中文别名等完整功能需求 @property({ type: String, caption: "IDE显示用的别名", tips: "这是一个文本对象,只能输入文本哦" }) public text1: string = ""; //装饰器属性类型的简写方式,适用于只定义类型的需求 @property(String...

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

2. 预制体模块 · LayaAir3.0文档 · LAYABOX [ 98%]

...criptA extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type: Laya.Box } ) private box: Laya.Box; constructor() { super(); } onStart(): void { //加载预制体文件 Laya.loader.load("resources/Title.lh").then( (res)=>{ //创建预制体 let label: Laya.Label = res.create(); /...

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

3. 实体组件系统 · LayaAir3.0文档 · LAYABOX [ 97%]

...需要显示Tips或属性的中文别名等完整功能需求 @property({ type: String, caption: "IDE显示用的别名", tips: "这是一个文本对象,只能输入文本哦" }) public text1: string = ""; //装饰器属性类型的简写方式,适用于只定义类型的需求 @property(String...

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

4. 程序蓝图 · LayaAir3.0文档 · LAYABOX [ 94%]

...: true, extends: "Script", construct: { params: [ { "name": "testParams", "type": "string" } ] } }) export class TestBluePrint extends Laya.Script { constructor(testParams: string) { super(); } } (图12-1) 3.2 属性 在变量前使用装饰器的标识@bpProperty,在get和set前使用装饰...

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

5. 组件属性的代码使用 · LayaAir3.0文档 · LAYABOX [ 92%]

...Laya; @regClass() export class NewScript extends Laya.Script { @property({ type : Laya.Sprite}) public spr: Laya.Sprite; onAwake(): void { this.spr.size(512, 313); //设置Sprite大小 this.spr.loadImage("atlas/comp/image.png"); //添加纹理 } } 效果如图1-2所示: (图1-2) 1.2 3D节点...

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

6. 事件管理 · LayaAir3.0文档 · LAYABOX [ 90%]

...vent.CLICK:string = "click"。CLICK 静态属性用于定义事件对象的type类型属性值为单击事件。这个事件是由鼠标点击触发后系统派发的事件,开发者也可以调用event()方法派发这些事件,如何派发事件会在下面的内容涉及。 (图2-2) 点...

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

7. 2.x引擎项目升级指南 · LayaAir3.0文档 · LAYABOX [ 87%]

...r3.0 Loader修改 1.1加载一个资源 示例: var url = "xxx.png"; var type = Laya.Loader.IMAGE; Laya.loader.load(url).then((res)=> { //不带类型,用于常规的资源 }); Laya.loader.load(url, type).then((res)=> { //带类型,用于区别同一后缀不同作用的资源。 //例...

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

8. 浏览器接口 · LayaAir3.0文档 · LAYABOX [ 83%]

...点元素的使用方法: /** * 创建浏览器原生节点。 * @param type 节点类型。 * @return 创建的节点对象的引用。 */ static createElement(type: string): any { Browser.__init__(); return Browser._document.createElement(type); } /** * 返回 Document 对象中拥有指定 id ...

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

9. UI滤镜效果 · LayaAir3.0文档 · LAYABOX [ 78%]

...ort class NewScript extends Laya.Script { // 获得Image组件 @property({ type: Laya.Image }) public img: Laya.Image; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { //创建一个颜色滤镜对象 let colorFilter: Laya.ColorF...

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

10. 3D变换 · LayaAir3.0文档 · LAYABOX [ 78%]

...脚本,添加装饰器暴露cube的属性,代码如下: @property({ type: Laya.Sprite3D }) public cube: Laya.Sprite3D; 然后在IDE中,将Cube节点拖入装饰器暴露的属性入口,即可用代码控制Cube节点了。 1. 平移变换 平移变换的定义如下: /** * 平移变换...

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