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

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

771. 继承自Laya.BaseMaterial并且自定义Shader的的自定义材质如何设置透明渲染 [ 90%]

... _mainCol : number; inited : boolean = false; constructor() { super(); if(!this.inited) { CMat._mainTex = Laya.Shader3D.propertyNameToID("u_MainTex"); CMat._mainCol = Laya.Shader3D.propertyNameToID("u_MainCol"); CMat.initShader(); this.inited = true; } this.setShaderName("CMatShader"); } public SetM...

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

772. 飞机大战地图滚动报错,麻烦看下? [ 90%]

...  bg2.pos(650, 0);     box.addChild(bg2);     Laya.timer.frameLoop(1, this, bg_loop()); } function bg_loop() {     box.x -= 1;     if (bg1.x + box.x <= 0) {         bg1.y = 650     }     if (bg2.x + box.x <= 0) {         bg2.x = 650     } } bg_rolling(); 以上是我把...

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

773. [LayaAir2]在使用videoDom创建视频元素后iPad跟iPhone中位置不一样 [ 90%]

...{ htmlvideo:Laya.HtmlVideo; constructor() { Laya.stage.on(Laya.Event.CLICK,this,this.onClick); } onClick(){ this.initVideo(); } initVideo() { this.htmlvideo = new Laya.HtmlVideo(); this.htmlvideo.setSource("https://www.layaair.com/3.x/de ... ot%3B,1); this.htmlvideo.video.addEventListener("loadedmet...

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

774. 龙骨动画play播放时,this._templet.getAnimationCount()报错? [ 90%]

龙骨动画play播放时,this._templet.getAnimationCount()报错? this._templet为空 getAnimNum值为0 啥原因引起的??? 2019-07-10 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 bobofuns - 我是...

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

775. 水平滚动条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.hscroll.skin = "atlas/comp/hscroll.png";//滚动条皮肤 this.hscroll.width = 300;//滚动条的宽度 this.hscroll.pos(300, 300);//滚动条的位置 this.hscroll.min = 0;//滑块的最小滚动位置 this.hscroll.max = ...

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

776. Laya截图3D场景相关模型,导致模型透视! [ 90%]

..., false); camera.orthographic = true; camera.orthographicVerticalSize = 5; this.effRes = Laya.Sprite3D.load(resUrl); this.effRes.on(Laya.Event.HIERARCHY_LOADED, this, function(){ this.eff1 = scene.addChild( Laya.Sprite3D.instantiate(this.effRes)); this.eff1.transform.position = new Laya.Vector3(0,0,...

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

777. 垂直滚动条组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

...和组件均已创建完毕,此方法只执行一次 onAwake(): void { this.vscroll.skin = "atlas/comp/vscroll.png";//滚动条皮肤 this.vscroll.width = 300;//滚动条的宽度 this.vscroll.pos(300, 300);//滚动条的位置 this.vscroll.min = 0;//滑块的最小滚动位置 this.vscroll.max = ...

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

778. 2D性能优化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 90%]

....Stat.show(); var textBox=new Laya.Sprite(); for(var i=0;i<10000;i++) { this.text=new Laya.Text(); this.text.text=(Math.random()*100).toFixed(0); this.text.color="#CCCCCC"; this.text.x=Math.random()*550; this.text.y=Math.random()*400; textBox.addChild(this.text); } Laya.stage.addChild(textBox); }...

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

779. Laya.Timer.clear 的源码可能有个问题。 [ 90%]

...最多执行6次 for(let i = 0; i < 6; i++){ Laya.timer.once(i * 1000, this, this.b, [i], false); } //遇到一些需求变化,我希望在2s之后(可能其它某些触发情况), 停止执行 b 函数(行为) Laya.timer.once(2000,this,()=>{ Laya.timer.clear(this, this.b); }); [/i]//程...

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

780. 获取sprite对象的 width和height为0 [ 90%]

...Boat extends Laya.Sprite { private bt:Laya.Sprite; constructor() { super() this.bt = new Laya.Sprite() this.bt.loadImage("res/boat.png") this.addChild(this.bt) } } /** * 游戏背景 */ class BackGround extends Laya.Sprite { //背景图 private bg:Laya.Sprite; constructor(){ super(); this.init(); } ...

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