大约有 388 项符合查询结果, 库内数据总量为 30,902 项。 (搜索耗时: 0.0047 秒)
...lass() export class Main extends Laya.Script { private tMap:Laya.TiledMap; onEnable() { //创建地图对象 this.tMap = new Laya.TiledMap(); //创建Rectangle实例,视口区域 var viewRect:Laya.Rectangle = new Laya.Rectangle(0, 0, Laya.stage.designWidth, Laya.stage.designHeight); //创建TiledM...
来源: Laya3.0_文档 发布时间: 20240910
...此时所有节点和组件均已创建完毕,此方法只执行一次 onEnable(): void { // 添加2D线渲染器组件 this.line2DRender = this.owner.addComponent(Laya.Line2DRender); // 设置线的宽度 this.line2DRender.lineWidth = 5; } // 鼠标按下时开始绘制 onMouseDown(evt: Laya.Even...
来源: Laya3.0_文档 发布时间: 20250214
...所有节点和组件均已创建完毕,此方法只会执行一次 | | onEnable | 组件被启用后执行,比如,节点被添加到舞台后执行 | | onStart | 在第1次执行update之前执行,只会执行一次, | | onUpdate | 每帧更新时执行,尽量不要在这里写大循环...
来源: Laya2.0_文档 发布时间: 20210715
...s/bg2.png"; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { Laya.loader.load(this.backgroundTexture).then(() => { this.createLightOccluder(); this.createSpotLight(); this.createBackground(); }); } // 创建2D光遮挡器 createLightOccluder(): void { this.lightOc...
来源: Laya3.0_文档 发布时间: 20250214
...类型的输出引脚。 如图2-7给出的示例,当蓝图节点触发onEnable生命周期时,开始打印”game start“,然后等待2秒 (这里的add就是参数节点,将1+1的结果输入给waitTime),再顺序执行打印“3”,2秒过后打印“4”。 (图2-7) 2.2 蓝...
来源: Laya3.0_文档 发布时间: 20250103
...{type:Laya.UI3D}) private ui3d: Laya.UI3D; public animator: Laya.Animator; onEnable() { // 广告牌模式 this.ui3d.billboard = true; //获得状态机 this.animator = this.target.getComponent<Laya.Animator>(Laya.Animator); } } 最后来看看运行效果: (动图4-2) Copyright ©Layabo...
来源: Laya3.0_文档 发布时间: 20250214
...nts Packagelaya.uiClasspublic class ScaleBoxInheritanceScaleBox Box UIComponent Sprite Node EventDispatcher Object 自适应缩放容器,容器设置大小后,容器大小始终保持stage大小,子内容按照原始最小宽高比缩放 Public Properties Hide Inherited Public Properties Show...
来源: Laya2.0_api 发布时间: 20190513
...置。 Node addChildren(... args):void 批量增加子节点 Node addComponent(type:Class):* 添加组件。 Node addComponentIntance(comp:Component):* 添加组件实例。 Node addInputChild(node:Node):NodeNode callLater(method:Function, args:Array = null):void 延迟运行指定的函数。 ...
来源: Laya2.0_api 发布时间: 20190513
...awtocanvCtx Accessors active activeInHierarchy alpha blendMode cacheAs components contextHeight contextWidth customRenderEnable destroyed displayHeight displayWidth displayedInStage drawCallOptimize filters globalRotation globalScaleX globalScaleY graphics height hideFlags hitArea href innerHTML is3...
来源: Laya3.0_api 发布时间: 20231102
...背景色为场景高度 this.box_color_bg.height = Laya.stage.height; } onEnable() { this.init(); // 判定是注册还是忘记密码 if (GameData.I.isReg) { this._regMode(); } else { this._forgetMode(); } // 添加取消事件 this.lb_cancel.on(Laya.Event.CLICK, this, () => { // 返回登陆...
来源: Laya_社区 发布时间: 20200410