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

大约有 1,122 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0058 秒)

201. 音频-播放演示 [ 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_示例 发布时间: 20240930

202. 音频-播放演示 [ 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_示例 发布时间: 20240930

203. 关于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

204. 屏幕适配-缩放-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_示例 发布时间: 20240930

205. 屏幕适配-缩放-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_示例 发布时间: 20240930

206. 【简单跑酷--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

207. 屏幕适配-缩放-Show All [ 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_示例 发布时间: 20240930

208. 屏幕适配-缩放-Extract Fit [ 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_示例 发布时间: 20240930

209. 骨骼动画-Spine事件 [ 79%]

...lSprite); mLabelSprite.x = mStartX; mLabelSprite.y = mStartY; mLabelSprite.graphics.clear(); mLabelSprite.graphics.fillText(tEventData.name, 0, 0, "20px Arial", "#ff0000", "center"); Tween.to(mLabelSprite, { y:mStartY - 200 }, 1000, null,Handler.create(this,playEnd)) } function playEnd() { mLabelSpr...

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

210. 为什么Laya.Panel的子节点在(0,0)位置会不显示呢? [ 79%]

... = 0; // 用下面这组数据是可显示的 // sp.y = 1; // sp.x = 1; sp.graphics.drawRect(0, 0, 200, 200, "#00FF00"); Laya.stage.addChild(panel);   这个是我的代码,sp是一个精灵,放在panel的0,0点后确实是不显示,往右下移一个像素后就能显示出来了 2017-02-20 0 0 ...

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