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

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

351. 陀螺仪与加速计 · LayaAir3.3 · 引擎文档 · LAYABOX [ 74%]

...ope_Sample { private info: Laya.Text; constructor() { Laya.init(550, 400); this.info = new Laya.Text(); this.info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height); Laya.stage.addChild(this.info); Laya.Gyroscope.instance.on(Laya.Event.CHANGE, this, this....

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

352. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 74%]

...,可以使用局部变量来保存它: ```typescript foo() { var prop=this.target.prop; //使用prop this.process1(prop); this.process2(prop); this.process3(prop); } ``` ### 二、计时器 LayaAir提供两种计时器循环来执行代码块。 1. `Laya.timer.frameLoop`执行频率依赖于帧...

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

353. 射线检测-放置物体 [ 74%]

...; meshCollider.mesh = plane.meshFilter.sharedMesh; Laya.timer.frameLoop(1, this, checkHit); var ray = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); var point = new Laya.Vector2(); var _outHitInfo = new Laya.RaycastHit(); function checkHit() { //从屏幕空间生成射线 point...

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

354. 分享:SWF LABEL标签的使用! [ 74%]

...EEFFCC"; mc=new MovieClip(); mc.load("output/AAA.swf"); mc.on(Event.LOADED,this,onLoaded); Laya.stage.addChild(mc); } private function onLoaded():void { mc.addLabel("label01",19); mc.addLabel("label02",39); mc.addLabel("label03",59); mc.on(Event.LABEL,this,onLabel);//运行到对应的帧数,会...

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

355. 摄像机捕捉目标(JavaScript-3D基础(JS)-LayaAir3D之Camera) [ 74%]

...,通过鼠标点击按钮切换注视目标。 ```typescript //up向量 this._up = new Laya.Vector3(0, 1, 0); ``` ```typescript //点击事件 this.changeActionButton.on(Laya.Event.CLICK, this, function(){ this.index++; if (this.index % 3 === 1 ){ //摄像机捕捉模型目标 this.camera.transfor...

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

356. localToGlobal获取坐标总是错误! [ 74%]

...知道是否是我代码的问题,附件有DEMO工程 let buttonTest = this.getChildByName("buttonTest"); this.sprteCenter = this.getChildByName("sprteCenter"); this.boxSpaw = this.getChildByName("boxSpaw"); //this.spriteSpaw.loadImage("../..") buttonTest.on(Laya.Event.CLICK,this,()=>{ let poin...

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

357. 陀螺仪与加速计(TypeScript-LayaAir基础篇(TS)-硬件设备相关) [ 74%]

...ope_Sample { private info: Laya.Text; constructor() { Laya.init(550, 400); this.info = new Laya.Text(); this.info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height); Laya.stage.addChild(this.info); Laya.Gyroscope.instance.on(Laya.Event.CHANGE, this, this....

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

358. 分享:Skeleton如何监听播放完成事件! [ 74%]

...画,会自动触发Event.COMPLET事件 skeleton.player.on(Event.COMPLETE,this,onComplete);2、当skeleton.play(0,false) 第二个参数为false时,当前动画播放完成后,会自动触发Event.STOPED事件,而不是Event.COMPLETE事件 skeleton.on(Event.STOPPED, this, completeHandler); 20...

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

359. 摄像机捕捉目标(TypeScript-3D基础(TS)-LayaAir3D之Camera) [ 74%]

... private _up = new Laya.Vector3(0, 1, 0); ``` ```typescript //点击事件 this.changeActionButton.on(Laya.Event.CLICK, this, function(){ this.index++; if (this.index % 3 === 1 ){ //摄像机捕捉模型目标 this.camera.transform.lookAt(this.box.transform.position, this._up); } else if (this.index...

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

360. hitArea用法问题 [ 74%]

...!  // 写法一 let g:Laya.Graphics = new Laya.Graphics(); g.drawRect(this.closeBtn.x-10,this.closeBtn.y-10,this.closeBtn.width+20,this.closeBtn.height+20,"#FF0000"); let hitA:Laya.HitArea = new Laya.HitArea(); hitA.hit = g; this.closeBtn.hitArea = hitA; // 写法二 this.closeBtn.graphics.drawRe...

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