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

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

321. TypeScript 泛形方法如何传TYPE? [ 75%]

...ComponentByType(Laya.Animator); if (element!=null) { return element; }else this.GetComponetInChild(node._childs[index],);   } } 如何写成泛型方法呢???编译不通过 GetComponetInChild<T>(node:laya.display.Node):T { // var s:=typeof(Laya.Animator); for (var index = 0; index < nod...

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

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

...{ 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

323. 针对2.0.0 beta5 setLoadingPage 做增强 [ 75%]

...异步方法 */ export default class LoadPage { constructor(url = null) { this._loadScene = null if (url) this.preload(url) } /** * 预加载loading页面 * @param {String} url loading页面url */ async preload(url = 'loadingpage.scene') { if (this._loadScene && url === this._loadScene.url) ...

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

324. Laya3D 官方请看:有关Laya.MeshSprite3D.instantiate的Bug [ 75%]

...ya.Sprite3D;  scene.addChild(temp);  temp.on(Laya.Event.HIERARCHY_LOADED,this,()=>  {  this.model = Laya.MeshSprite3D.instantiate(temp,scene) as Laya.MeshSprite3D;  if(index == 0)  {  this.model.transform.position = new Laya.Vector3(0.8,0,0);  }  });    //===================报错=====...

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

325. 代码怎么判断ui加载完成 [ 75%]

...断它有没有完成加载并显示到舞台上呢 mainMC.on(Event.LOADED,this,stopMC); mainMC.on(Event.COMPLETE,this,stopMC);这俩货监听都不好用   附件 : --> 2016-12-13 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提...

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

326. laya.sprite 不接受click事件 [ 75%]

laya.sprite 不接受click事件 代码如下: this._firstSprite= new Laya.Sprite(); this._firstSprite.pos(100,150); Laya.stage.addChild(this._firstSprite); this._firstSprite.loadImage('../laya/assets/image/0.jpg'); //this._firstSprite.scale(0.3,0.3); this._firstSprite.size(200,200); //this._firs...

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

327. 如何使用graphics.loadImage加载图片资源的时候,如何判断加载失败? [ 75%]

...mage加载图片资源的时候,如何判断加载失败? 伪代码: this.avatar.graphics.loadImage(url, 0, 0, 0, 0, __complete);这个时候,如果我的url为空或者为一个不存在的图片地址,我如何判断它加载失败呢? 我尝试使用了这样的代码来获取失败...

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

328. Uncaught TypeError: Cannot read property 'XXX' of undefined [ 75%]

...OWN, spe, onMouseDown);             Laya.stage.on(Event.MOUSE_UP, this, onMouseUp);             Laya.stage.on(Event.MOUSE_OUT, this, onMouseUp);   } private function onMouseDown(e:Event):void {             spe.startDrag(new Rectangle(0,0,800,800)); } 鼠标点击Sprite报...

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

329. 怎么给List下的每个item中的button添加事件? [ 75%]

...: 2347 关注: 2 人 lolololo • 2018-09-12 17:22 var btns = new Array; this.btnBox = new Laya.Sprite(); Laya.stage.addChild(this.btnBox); for(var i = 0; i < 5; i++){ var btn = new Laya.Sprite(); btn.loadImage("Key.jpg",i*100,800,100,60); btn.id= i; btns.push(btn); this.btnBox.addChild...

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

330. 分享:改变图片皮肤,保持图片原样宽高显示 [ 75%]

... Laya.init(800,600); Laya.loader.load(["bg.jpg","logo.png"],Handler.create(this,onLoaded)); } private function onLoaded():void { image=new Image(); image.skin="logo.png"; Laya.stage.addChild(image); Laya.stage.on(Event.CLICK,this,onClick); } private function onClick():void { image.skin="bg.jpg"; } }...

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