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

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

201. 关于removeChildren、 destroy和destroyChildren的疑惑 [ 80%]

...n sightBeadSprite() { SightBead.super(this); this.name = 'sightBead'; this.graphics.drawCircle(0,0,40,null,'#ff0000',1); this.graphics.drawLine(-45,0,45,0,'#ff0000',1); this.graphics.drawLine(0,45,0,-45,'#ff0000',1); this.alpha = 0; Laya.stage.addChild(this); // this.pos(440,640); } Laya.class(sight...

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

202. 关于切换图片的问题 [ 80%]

...; this.img.loadImage(this.plane1); Laya.stage.addChild(this.img); this.img.graphics.clear(); this.img.loadImage(this.plane2); Laya.stage.addChild(this.img) } } new Main(); 出来的结果是两张图合并到了一起, 于是我再尝试 constructor() { Laya.init(1000,800); this.img = new Laya.Spr...

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

203. 动态创建img 或 sprite [ 80%]

LayaAir引擎 动态创建img 或 sprite let dd = new Laya.Sprite(); dd.graphics.drawTexture(this.img.texture, 0, 0, 750, 1334); dd.x = 50; dd.y = 50; this.addChild(dd);   this.img 绝对不为空,我想用一个sprite来画它,请问什么画(不是拷贝)?   2018-01-24 添加评论 ...

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

204. 音频-播放演示 [ 80%]

...ite; let btn = new Sprite(); Laya.stage.addChild(btn); btn.size(w, h); btn.graphics.drawRect(0, 0, w, h, "#FF7F50"); btn.graphics.fillText(labelText, w / 2, 8, "24px SimHei", "#FFFFFF", "center"); return btn; } // 播放音效 onPlaySound() { console.log("播放音效"); Laya.SoundManager.playSound(...

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

205. 圆环不跟随 sprite 一起缩放? [ 80%]

...otSp = new Laya.Sprite();  this.firstSp = new Laya.Sprite(); this.firstSp.graphics.drawRect(0, -100, 200, 200, null, "#ffffff"); this.firstSp.graphics.drawLine(0, 0, 100, 100, "#ffffff", 5); this.firstSp.graphics.drawCircle(100, 100, 20, null, "ffffff"); Laya.stage.on(Laya.Event.MOUSE_WHEEL, this, ...

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

206. 音频-播放演示 [ 80%]

... w = 110; var h = 40; var button = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.graphics.fillText(label, w / 2, 8, "25px SimHei", "#FFFFFF", "center"); Laya.stage.addChild(button); return button; } function onPlayMusic(e) { console.log("播放音乐"); Sou...

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

207. 关于fillText问题 [ 80%]

...问题 private label_image:Laya.Sprite=new Laya.Sprite(); this.label_image.graphics.fillText(xxx, xxx,"15px Arial","#000000","center"); this.label_image.pos(0,0) Laya.stage.addChild(this.label_image); 这样写为什么CurMem会增加接近16M,这不就是在精灵上绘制嘛,简单来说就...

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

208. 屏幕适配-缩放-No Scale [ 79%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Lay...

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

209. 屏幕适配-缩放-No Border [ 79%]

...tralRect(); })(); function createCantralRect() { rect = new Sprite(); rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(rect); updateRectPos(); } function updateRectPos() { rect.x = Laya.stage.width / 2; rect.y = Laya.stage.height / 2; } })();module laya { import Sprite = Lay...

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

210. 【简单跑酷--JS版】---Lv.3 添加地板 [ 79%]

...ader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); //将当前的坐标向上移动32 方便后面处理人物的位置 this.bg.y = -32; this.addChild(this.bg); } this.bg.graphics.drawTexture(this.bgTexture, 0, 0, 960, 96); //创建一个帧循环处理函...

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