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

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

1. 使用二进制图片 · LayaAir3.0文档 · LAYABOX [ 100%]

...代码如下: var xhr = new XMLHttpRequest(); xhr.open("get", "res/atlas/comp.png", true); xhr.responseType = "arraybuffer"; xhr.onload = function () { if (this.status == 200) { var blob = new Blob([this.response], { type: "image/png" }); var img = document.createElement("img"); img.onload = funct...

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

2. 树状列表组件 · LayaAir3.0文档 · LAYABOX [ 99%]

...毕,此方法只执行一次 onAwake(): void { var res: any[] = ["atlas/comp/vscroll.png", "atlas/comp/vscroll$bar.png", "atlas/comp/vscroll$down.png", "atlas/comp/vscroll$up.png", "resources/tree/clip_selectBox.png", "resources/tree/clip_tree_folder.png", "resources/tree/clip_tree_arrow.png"]; La...

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

3. 多行输入文本组件 · LayaAir3.0文档 · LAYABOX [ 94%]

...his.txtarea.overflow = "scroll"; //文本溢出 this.txtarea.skin = "atlas/comp/textarea.png"; //皮肤 this.txtarea.borderColor = "#f6ff03" //边框颜色 this.txtarea.scrollType = Laya.ScrollType.Vertical; //滚动方式 this.txtarea.vScrollBarSkin = "atlas/comp/vscroll.png"; //滚动条皮肤 } }...

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

4. 精灵 · LayaAir3.0文档 · LAYABOX [ 91%]

...此方法只执行一次 */ onAwake(): void { this.sprite.loadImage("atlas/comp/image.png"); //纹理:图片路径 this.sprite.pos(Laya.stage.width >> 1, Laya.stage.height >> 1); //位置:屏幕中心 this.sprite.x = Laya.stage.width/2; //x、y分别设置位置 this.sprite.y = Laya....

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

5. 按钮组件 · LayaAir3.0文档 · LAYABOX [ 89%]

...wake(): void { this.btn.scale(5, 5); //放大五倍 this.btn.skin = "atlas/comp/button.png"; //皮肤 this.btn.stateNum = 3; //皮肤状态 this.btn.label = "确定"; //文本标签 this.btn.labelFont = "宋体"; //文本标签字体 this.btn.labelSize = 20; //文本标签字体大小 this.btn.label...

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

6. 位图切片组件 · LayaAir3.0文档 · LAYABOX [ 87%]

...t;> 1, Laya.stage.height >> 1); // 位置 this.clip.skin = "atlas/comp/clip_num.png"; // 皮肤 this.clip.interval = 1000; // 切片动画的播放时间间隔1000毫秒 this.clip.clipX = 10; // 切片x轴数量 this.clip.autoPlay = true; // 动画自动播放 } } 二、通过代码创建Cl...

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

7. 输入文本组件 · LayaAir3.0文档 · LAYABOX [ 86%]

...this.txtin.overflow = "scroll"; //文本溢出 // this.txtin.skin = "atlas/comp/textinput.png"; //皮肤 this.txtin.bgColor = "#19a4f1"; //背景颜色 this.txtin.borderColor = "#f6ff03" //边框颜色 this.txtin.editable = true; //可编辑状态 // this.txtin.type = "password"; //输入框类型 /...

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

8. 通用发布 · LayaAir3.0文档 · LAYABOX [ 77%]

...g”。 例如:现在我们将图3-5中原来的小图 img_head2.png comp 目录下的 image.png 在项目中通过图集的方式显示出来,示例代码如下: let resArr: Array<any> = [ { url: "resources/atlas/Atlas.atlas", type: Laya.Loader.ATLAS }, { url: "resources/atlas/Atlas...

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

9. 下拉选项框组件 · LayaAir3.0文档 · LAYABOX [ 70%]

...ff"; this.combobox.selectedIndex = 1; this.combobox.scrollBarSkin = "atlas/comp/vscroll.png"; } } 二、通过代码创建ComboBox组件 在进行书写代码的时候,免不了通过代码控制UI,创建UI_ComboBox类,通过代码设定ComboBox相关的属性。下述示例演示了如何通...

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

10. 插件开发说明 · LayaAir3.0文档 · LAYABOX [ 62%]

...改组件属性,场景里的对象会自动同步,无需手动 node.getComponent("MeshRenderer").props.enabled = false; 2、调用节点/组件的一个方法,并返回值。例如: //下面是UI进程代码 //获取选中的节点 let node = Editor.scene.getSelection()[0]; //调用MyScript...

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