大约有 210 项符合查询结果, 库内数据总量为 30,897 项。 (搜索耗时: 0.0042 秒)
...ya; @regClass() export class LightEffectDemo extends Laya.Script { declare owner: Laya.Sprite; private lightComp: Laya.FreeformLight2D; private rotateSpeed: number = 2; // 增加旋转速度 private scaleTime: number = 0; private scaleSpeed: number = 3; // 增加缩放速度 private intensity: numbe...
来源: Laya3.0_文档 发布时间: 20250214
...s = bt.btCollisionObject_getCollisionFlags(btColObj); if (this.owner.isStatic) { if ((flags & PhysicsComponent.COLLISIONFLAGS_KINEMATIC_OBJECT) > 0) flags = flags ^ PhysicsComponent.COLLISIONFLAGS_KINEMATIC_OBJECT; flags ...
来源: Laya_社区 发布时间: 20200505
...器的示例代码 */ export class NewScript extends Laya.Script { declare owner: Laya.Sprite; private _trail2D: Laya.Trail2DRender; //从场景文件中获取到的宽度曲线数据 private _widthCurve: any[]; //从场景文件中获取到的颜色渐变数据 private _gradient: any; //组件被...
来源: Laya3.0_文档 发布时间: 20250214
...e2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHandler(e: any = null): void { this.onLoaded(); } } 编译运行代码,效果如图3-3所示,说明地图已创建成功。 (图3-3...
来源: Laya3.0_文档 发布时间: 20240910
...= Laya; @regClass() export class NewScript extends Laya.Script { //declare owner : Laya.Sprite3D; @property({ type: Laya.OpenDataContextView }) public opendata: Laya.OpenDataContextView; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此...
来源: Laya3.0_文档 发布时间: 20240910
...如下代码: onAwake(): void { //侦听自定义的事件"Click" this.owner.on("Click",this,()=>{ console.log("侦听到自定义的“Click”事件"); }) } //鼠标点击后执行,发送Click事件。 onMouseClick(evt: Laya.Event): void { //自定义的事件 this.owner.event("Click"); } ...
来源: Laya3.0_文档 发布时间: 20240910
... //加载Base64图片数据 sp1.loadImage(e.target.result as string); this.owner.addChild(sp1); } }); 上述代码中,用 Laya.loader.fetch 加载图片二进制数据,根据自定义的规则,可以解析数据加密方式,并获得完整图片数据。在这里我们更多的介绍一下 L...
来源: Laya3.0_文档 发布时间: 20230303
....0.3 的VideoNode不支持在微信浏览器中播放 let videoNode = this.owner.getChildByName("VideoNode") as Laya.VideoNode; videoNode.source = 'xxx.mp4'; videoNode.play(); // 上面代码在PC端安卓苹果等自带浏览器支持视频播放,但是在微信浏览器无任何显示。 let mat...
来源: Laya_社区 发布时间: 20230825
...aya; @regClass() export class LabelControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.Label } ) public lab: Laya.Label; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake...
来源: Laya3.0_文档 发布时间: 20240910
... RuntimeScript; onStart() { // 获得场景的Runtime对象 this.ui = this.owner.scene as RuntimeScript; // Button添加鼠标事件,让Image不显示 this.ui.Button.on( Laya.Event.MOUSE_DOWN, null, ()=>{ this.ui.Image.visible = false; }); } } ui 属性直接从脚本中通过 this.owner.scene ...
来源: Laya3.0_文档 发布时间: 20250217