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

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

691. js继承模式 [ 65%]

...ion() { for (var i = 0; i < this.img.length; i++) { this.img[i].y += 1; if (this.img[i].y >= 852) { this.img[i].y = -852; } } }; return Class; }()); new function() { var className = 'BackGround'; window[className] = (function() { Laya.class(Class, className, Laya.Sprite); function Class() { Cl...

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

692. 重复背景,全方向地图拖动Demo [ 65%]

...s.map0.x = X this.map0.y = Y this.map3.x = X + 1800 this.map3.y = Y + 1800 if(X < -540){ this.map1.x = X + 1800 this.map1.y = Y }else{ this.map1.x = X - 1800 this.map1.y = Y } if(Y > -260){ this.map2.x = X this.map2.y = Y - 1800 }else{ this.map2.x = X this.map2.y = Y + 1800 } } mouseDown(){ th...

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

693. 微信小游戏中不能加载proto文件 [ 65%]

...etsLoaded(err, root) { console.log("____________________________________") if (err) throw err;  // Obtain a message type var AwesomeMessage = root.lookup("msg.LoginReq");  // Create a new message var message = AwesomeMessage.create( { openid: "AwesomeString" });  console.log(message.openid) // Ve...

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

694. laya2.0 IDE继承自定义类要怎么写? [ 65%]

...不一样,仅供参考     24522                         if(this.projectSetting.codeType==1){     24523                                 classObj["classType"]="Laya." + baseName;     24524                         } 3.修改为下面样子,其实就...

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

695. Node.prototype._activeHierarchy存在的bug或者说是onEnable和onAwake的坑 [ 65%]

...this._setBit(/*laya.Const.ACTIVE_INHIERARCHY*/0x02,true);         if (this._components){             for (var i=0,n=this._components.length;i < n;i++){                 var comp=this._components[i];                 comp._setActive(true);     ...

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

696. 关于声音(TypeScript-LayaNative原生服务-LayaNative基础文档) [ 65%]

...否为LayaNative运行环境的,伪代码如下所示: ```javascript if(window.conch) { ...加载 "soundConfig-LayaPlayer.json" } else { ...加载 "soundConfig-json" } SoundManager.playSound(soundJson[0].url,1); .... SoundManager.playSound(soundJson[1].url,1); ``` **Tips** *1、conch只能LayaNa...

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

697. list的selectHandler属性连续点击同一个item不能重复接收事件 [ 65%]

... 改源码方案可以这样: laya.ui.js改成这样即可,去掉判断if (this._selectedIndex !=value)     __getset(0,__proto,'selectedIndex',function(){         return this._selectedIndex;         },function(value){         //if (this._selectedIndex !=value){    ...

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

698. putimagedata 不起作用 [ 65%]

...geData.height, i = 0, l = data.length, x, y, d for (i; i < l; i += 4) { if (data[i]!== 0) { console.log(data[i]) } x = i / 4 % w y = Math.ceil(i / 4 / w) - 1 d = Math.ceil(20 * Math.sin(0.071 * y)) if (x + d <= 0 || x + d > w) { data[i + 3] = 0 } else { data[i] = copy[i + d * 4] data[i + 1]...

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

699. 读本地文件必须是ASCII编码 [ 65%]

... bawfnpdc • 2018-05-31 17:26 MiniAdpter.getUrlEncode=function(url,type){ if(url.indexOf(".fnt")!=-1) return "utf8"; else if(type=="arraybuffer") return ""; return "utf8"; // return "ascii"; } 现在Json转ASCII是有问题,但如果把...

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

700. QQ玩一玩 获取头像后的数据是 BK.Buffer,需要如何用laya的Image显示出来? [ 65%]

...要如何用laya的Image显示出来?function callback(openID, BuffInfo){ if(openID == openID1) { var buff = BuffInfo.buffer; var width = BuffInfo.width; var height = BuffInfo.height; BK.Script.log(0,0,"headeBuff :"+ openId + " buff:"+ buff + " width:"+ width +" height:"+height); var tex = new BK.Te...

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