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

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

41. 鼠标脚本(JavaScript-3D基础(JS)-LayaAir3D之鼠标交互) [ 73%]

...本。 > **脚本类**: ```typescript export default class MouseScript extends Laya.Script3D{ constructor(){super();} //物体必须拥有碰撞组件(Collider) //当被鼠标点击 onMouseDown(e){ //console.log("点击到了我box",owner.name); //从父容器销毁我自己 this.owner.removeS...

来源: Laya2.0_文档 发布时间: 20210715

42. runTime使用(JavaScript-IDE篇(JS)-组件化开发相关) [ 73%]

...部代码如下所示: ```typescript export default class ImageRunTime extends Laya.Image{ constructor(){ super(); this.scaleTime = 100; //设置组件的中心点 this.anchorX = this.anchorY = 0.5; //添加鼠标按下事件侦听。按时时缩小按钮。 this.on(Laya.Event.MOUSE_DOWN,this,this...

来源: Laya2.0_文档 发布时间: 20210715

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

...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

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

...{ 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

45. Laya中的宏编译要怎么用啊 [ 72%]

...flash.display.StageScaleMode; import flash.events.Event; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); this.stage.s...

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

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

... 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

47. 鼠标脚本(TypeScript-3D基础(TS)-LayaAir3D之鼠标交互) [ 72%]

...本。 > **脚本类**: ```typescript export default class MouseScript extends Laya.Script3D{ private meshsp:Laya.MeshSprite3D; constructor(){super();} /** * 覆写3D对象组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake(){ this.meshsp ...

来源: Laya2.0_文档 发布时间: 20210715

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

... 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

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

... 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

50. 单选框组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 71%]

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

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