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

大约有 6,579 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0116 秒)

401. Laya.stage.addChild在别的脚本里面调用无效 [ 86%]

...r,一个是Fire 。我在主类GameStart里面调用 Laya.stage.addChild(new Player())和Laya.stage.addChild(new Fire()),这两个精灵都能在舞台上面显示,但是当我把aya.stage.addChild(new Fire()) 放到类Player中的构造函数中时,舞台上面只有Player精灵...

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

402. 鼠标交互-拖动 [ 86%]

...} createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(ApePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya....

来源: Laya2.0_示例 发布时间: 20251130

403. 三个图好像无法绑定不同的事件? [ 86%]

...绑定不同的事件? Laya.init(400, 400, laya.webgl.WebGL); var img1 = new Laya.Sprite(); img1.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/apes/monkey2.png',100,100,90,90); Laya.stage.addChild(img1); img1.on(Laya.Event.CLICK,this, function(name){ console.log(name);},['图1']); var img...

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

404. 打飞机点开始游戏加载飞机动画不出来,点重新开始,才出来,新手求助! [ 86%]

...结束,点重新开始,飞机才出来 function onLoaded() { start = new GameStartUI(); start.btn_start.on(Event.MOUSE_UP,this,gameInit) Laya.stage.addChild(start); } function gameInit() { map = new GameBgUI(); Laya.stage.addChild(map); play = new GamPlayUI(); Laya.stage.addChild(play); hero = n...

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

405. 请问我导入3d模型一直找不到它 [ 85%]

...意 ts 1.4  添加一盏灯光     var directionLight =scene.addChild(new Laya.DirectionLight()) as Laya.DirectionLight;             directionLight.ambientColor = new Laya.Vector3(0.7, 0.6, 0.6);             directionLight.specularColor = new Laya.Vector3(1.0, 1.0, 0.9);     ...

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

406. 屏幕适配-缩放-No Border [ 85%]

...ralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } n...

来源: Laya2.0_示例 发布时间: 20251130

407. 屏幕适配-缩放-No Scale [ 85%]

...ralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } n...

来源: Laya2.0_示例 发布时间: 20251130

408. 真机上随机报错 [ 85%]

...a.d3.js:24049: RangeError: Array buffer allocation failed this._vertices = new Float32Array(this._floatCountPerVertex * lastVBVertexCount); ^^ RangeError: Array buffer allocation failed at new ArrayBuffer (<anonymous>) at new Float32Array (<anonymous>) at ShurikenParticleSystem._initBuff...

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

409. 分享一个Shader版的CoolDown实现 [ 85%]

...var texture: Laya.Texture = Laya.Loader.getRes("progress.png"); this.spe = new coolDownSprite(); this.spe.init(texture); //this.spe.initWithoutTexture(128, 128); this.spe.pos(300, 350); this.spe.setProgress(this.progress); Laya.stage.addChild(this.spe); ----------------------源码------------------...

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

410. 屏幕适配-缩放-Extract Fit [ 85%]

...ralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rect.y = Laya.stage.height / 2; } } n...

来源: Laya2.0_示例 发布时间: 20251130