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

大约有 141 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0042 秒)

131. 使用方向键 控制精灵在格子中移动 [ 47%]

... Laya.timer.frameLoop(1,this,this.loop);事件响应 onkeyup(e){ for(let i:number = 0;i<this.keyList.length;i++){ if(this.keyList[i]==e.keyCode){ this.keyList.splice(i,1); break; } } } onkeydown(e){ if(this.keyList.indexOf(e.keyCode)<0){ this.keyList.push(e.keyCode); } } loop(){ if(this.sp.x!=...

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

132. 这样的panel请问如何实现比较好? [ 47%]

...layoutSecond.visible = false; } //点击切换状态 private change(state: number, e: Laya.Event) { e.stopPropagation(); this.state = state; this.layoutSecond.visible = (state === 0); this.btnFirst.visible = (state !== 0);  } }   2.定义一个界面,界面上放一个Panel(因为要滑动) clas...

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

133. 要做一个方形倒计时,请问该怎么实现,不知道该怎么做 [ 47%]

...ART:int = -90; public static const COLOR:String = "#000000"; private var r:Number = BarCell.WID / Math.SQRT2; private var rect:Rectangle = new Rectangle(0,0,BarCell.WID,BarCell.WID); private var pos:int = BarCell.WID*0.5; private var endTime:int; private var cdTime:int; public var isCd:Boolean = fal...

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

134. 高级应用-寻路导航 [ 46%]

...ivate _quaternion: Laya.Quaternion = new Laya.Quaternion(); private index: number = 0; private curPathIndex: number = 0; private nextPathIndex: number = 1; private moveSprite3D: Laya.Sprite3D; private pointCount: number = 10; private scene: Laya.Scene; constructor() { Laya3D.init(0, 0, true); Laya.s...

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

135. 菜鸟提问:请问使用LayaAir的话,AS3原生类以及一些第三方库完全不能用是吗? [ 45%]

...以用,基础类型Numer,String,Object可以用,Int估计也是用Number凑合着用,JS有的那就可以用,JS没有的就必须用Laya引擎提供的库的API才行是吗?   希望能得到解答,万分感谢!! 2017-05-10 添加评论 免费帖 --> 分享 微博 QZONE 微信 ...

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

136. 角色模型的材质列表切换后,不播放动作了 [ 44%]

...class CustomMaterial extends Laya.BaseMaterial { static DIFFUSETEXTURE_ID: number = 1; constructor() { super(); this.setShaderName("CustomShader"); } public getDiffuseTexture(): Laya.BaseTexture { return this._getTexture(CustomMaterial.DIFFUSETEXTURE_ID); } public setDiffuseTexture(value: Laya.BaseT...

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

137. 使用UI组件tree时,添加的数据结构必须是xml吗?添加xml时对于tree的单元格里面的label如何控制例如visible的属性 [ 43%]

...alpha属性并赋值给Item对象 if(e._dataSource.isAlpha) { var alphaNum:Number=e._dataSource.isAlpha; e.alpha=alphaNum; }//如果未设置alpha的项,则默认透明度为1 else { e.alpha=1; } }附件已经上传,可以参考,把alpha改成你对应的visible属性即可!   TreeAlpha.rar...

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

138. localRotationEulerY旋转位置错误 [ 41%]

...t point2 = this.arr[1].transform.position;         let angle: number = Math.atan2((point2.x - point1.x), (point2.z - point1.z)) * (180 / Math.PI); //角度         this.arr[0].transform.localRotationEulerY = angle;         console.log("position = ",this.a...

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

139. 加载.lh文件 运行后黑屏 无法显示 [ 35%]

...ctor3;     private lastPosition:Laya.Vector2;     private distance:number = 0.0;     private disVector1:Laya.Vector2;     private disVector2:Laya.Vector2;     private isTwoTouch:boolean;     private first:boolean;     private twoFirst:boolean; constructor(){       ...

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

140. (实现手指控制模型的缩放旋转)触控可以识别 但是导入的模型没有根据触控反应 [ 35%]

...ctor3;     private lastPosition:Laya.Vector2;     private distance:number = 0.0;     private disVector1:Laya.Vector2;     private disVector2:Laya.Vector2;     private isTwoTouch:boolean;     private first:boolean;     private twoFirst:boolean; constructor(){       ...

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