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

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

71. 2.0下资源加载和销毁内存问题 [ 69%]

...片大小为640*1038,900K    先创建一个img实例 class bitmapimg extends Laya.Image //2.0版本 这里区别为export default class bitmap extends Laya.Image { private szurl:string="" constructor(url:string){ super() this.onUrlChangeHandler(url); } protected onUrlChangeHandler(url:string):v...

来源: Laya_社区 发布时间: 20181201

72. 组件属性的代码使用 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

... const { regClass, property } = 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所...

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

73. [LayaAir3]Pool对象池获取继承对象时会返回基类对象 [ 68%]

...对象 const { regClass, property } = Laya; @regClass() export class Main extends Laya.Script { onStart() { let item1 = Laya.Pool.createByClass(TestClass); console.log('item1:', item1.type); Laya.Pool.recoverByClass(item1); let item2 = Laya.Pool.createByClass(TestClass2); console.log('item2:', item2...

来源: Laya_社区 发布时间: 20250819

74. 报错:找不到基类,按照laya社区的解答做了,但是导致了另外一个类和接口出现一样的错 [ 68%]

...     * @author xiaozhibin      */      public class HelloLayaBox extends Sprite     {         public function HelloLayaBox()         {             Laya.init(600, 300);             var txt:Text = new Text();             txt.text = "HelloLayaBox";  ...

来源: Laya_社区 发布时间: 20171025

75. 多行输入文本组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

...st { regClass, property } = Laya; @regClass() export class TextAreaControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextArea } ) public txtarea: Laya.TextArea; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建...

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

76. 角色控制器 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

...{ regClass, property } = Laya; @regClass() export default class DirectMove extends Laya.Script { declare owner: Laya.Sprite3D; private characterController: Laya.CharacterController; onAwake(): void { // 获取 角色控制器 组件并赋值给 characterController this.characterController = this.own...

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

77. 面板容器组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 68%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.Panel }) public panel: Laya.Panel; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.panel.pos(100, 100); t...

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

78. 垂直布局容器组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 67%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.VBox }) public vbox: Laya.VBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.vbox.pos(100, 100); this....

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

79. 水平布局容器组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 67%]

... const { regClass, property } = Laya; @regClass() export class NewScript extends Laya.Script { @property({ type: Laya.HBox }) public hbox: Laya.HBox; //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.hbox.pos(100, 100); this....

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

80. UI-List [ 67%]

...+ index); } } import Box = Laya.Box; import Image = Laya.Image; class Item extends Box { public static WID: number = 373; public static HEI: number = 85; private img: Image; constructor(){ super(); this.size(Item.WID, Item.HEI); this.img = new Image(); this.addChild(this.img); } public setImg(src: s...

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