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

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

331. 组件脚本的内置方法 · LayaAir3.4 · 引擎文档 · LAYABOX [ 85%]

...象池中。 ani.getControllerLayer().defaultState.on(Laya.AnimatorState2D.EVENT_OnStateExit, () => { aniNode.removeSelf();//删除动画节点 Laya.Pool.recover("effect", aniNode);//回收动画预制体到对象池中,方便下次复用。 }); return aniNode; } //组件被禁用时执行 onDi...

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

332. laya.resource.BaseTexture_API3.0 [ 85%]

...ference _removeReference _setCPUMemory _setCreateURL _setGPUMemory destroy event gpuCompressFormat hasListener isCreateFromURL off offAll offAllCaller on once destroyUnusedResources Constructors constructor new BaseTexture(width: number, height: number, format: number): BaseTexture Overrides Resourc...

来源: Laya3.0_api 发布时间: 20231115

333. 输入设备-摇一摇 [ 85%]

...t Shake = Laya.Shake; Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, this.onShake); console.text = '开始接收设备摇动\n'; } onShake() { const Shake = Laya.Shake; shakeCount++; console.text += "设备摇晃了" + shakeCount + "次\n"; if (shakeCount >= 3) { Shake.inst...

来源: Laya2.0_示例 发布时间: 20260303

334. Sprite-旋转缩放 [ 85%]

...dule laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_RoateAndScale { private ape: Sprite; private scaleDelta: number = 0; constructor() { // 不支持WebGL时自动切换至Canvas ...

来源: Laya2.0_示例 发布时间: 20260303

335. laya.ani.swf.MovieClip [ 85%]

...l Classes | Index | Frames No Frames MovieClipProperties | Methods | Events Packagelaya.ani.swfClasspublic class MovieClipInheritanceMovieClip Sprite Node EventDispatcher Object MovieClip 用于播放经过工具处理后的 swf 动画。 Public Properties Hide Inherited Public Properties Sho...

来源: laya_api 发布时间: 20170929

336. 怎么实现同一个工程内分包? [ 85%]

...lash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import login.LoginView; 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 { remov...

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

337. matter中有没有类似于unity中的OnCollision碰撞检测函数呀,用js怎么写 [ 84%]

...有。这个我给你个demo,你自己看看。 1.初始化 this.Matter.Events.on(this._engine, 'collisionActive', this.onCollision);   2.碰撞检测 private onCollision(event): void { console.log("碰撞了..");  var home = _gamePage._mainPage._playPage;  for(var i = 0; i < event.pairs.len...

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

338. js socket 连接不上 [ 84%]

...03:8888"); // this.socket.connect("10.10.1.103",8888); this.socket.on(Laya.Event.OPEN, this, openHandler); //建立连接 this.socket.on(Laya.Event.MESSAGE, this, receiveHandler); //接收到数据触发函数 this.socket.on(Laya.Event.CLOSE, this, closeHandler); //关闭事件 this.socket.on(Laya.E...

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

339. websocket连接, ws 时没问题,改成 wss 没反应 [ 84%]

...ectByUrl("wss://192.168.1.250:5000/websocket/");     this.socket.on(Laya.Event.OPEN, this, this.openHandler);     this.socket.on(Laya.Event.MESSAGE, this, this.receiveHandler);     this.socket.on(Laya.Event.CLOSE, this, this.closeHandler);     this.socket.on(Laya.Event.ERROR, this, this.erro...

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

340. spine动画放大后,遮罩显示不正常 [ 84%]

...      const         Templet = Laya.Templet,         Event = Laya.Event;         let mFactory = new Templet();         mFactory.on(Event.COMPLETE, this, this.parseComplete,[parent,mFactory]);         mFactory.on(Event.ERROR, this, this.onError);     ...

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