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

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

391. laya中js 如何实现Sprite类继承 [ 85%]

...ole = new Role(); this.RoleMap = new Laya.Sprite(); this.RoleMap.size(Laya.stage.width, Laya.stage.height/2); Laya.stage.addChild(this.RoleMap); this.RoleMap.addChild(this.Role); this.Role.pivot(16,24);// 图片32x48 this.Role.pos(100, 200);   Role.js基础代码: var Role = ( function ( _super )...

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

392. 关于button的click监听 [ 85%]

...:Laya.Button=new Laya.Button(); btn.label="AAAAAA"; btn.pos(200,200); Laya.stage.addChild(btn); btn.on(Laya.Event.CLICK,this,()=>{console.log("click button");});   请问 这样监听不到button的点击事件吗?如果我创建一个ui.view  a  a.on 也监听不到吗 2017-11-28 添加评...

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

393. 图片像素精准点击问题! [ 85%]

...class demo { private down:Laya.Image; constructor() { // 鼠标事件 Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.onMouseDown); Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.onMouseMove); Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseUp, [true]); } /** 按钮动画处理 */ private hitT...

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

394. 解决游戏最小化退到后台后浏览器会强制1秒执行一次ILaya.stage._loop() [ 85%]

...决游戏最小化退到后台后浏览器会强制1秒执行一次ILaya.stage._loop()       ILaya.m_worker = new Worker("libs/sleepThread.js");     ILaya.m_worker.onmessage = function () {         if (!ILaya.stage.isVisibility) {             // console.log("_e...

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

395. 微信小游戏截图问题 [ 84%]

...,可以带到下面那些东西怎么转成图片呢? var htmlC = Laya.stage.drawToTexture(Laya.stage.width,Laya.stage.height,0,0); this.ctx.graphics.drawTexture(htmlC, 0, 0,this.ctx.width,this.ctx.height); console.log(htmlC) console.log(htmlC.getPixels(0,0,this.ctx.width,this.ctx.height)) 能...

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

396. 鼠标穿透问题 [ 84%]

... 代码如下:package { import laya.display.Sprite; import laya.display.Stage; import laya.net.Loader; import laya.ui.Image; import laya.ui.List; import laya.utils.Handler; import laya.webgl.WebGL; public class Bootstrapper extends Sprite { protected var _list:List; protected var _items:Array; pro...

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

397. 屏幕适配-自动竖屏 [ 84%]

...rtrait { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.sc...

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

398. 屏幕适配-自动横屏 [ 84%]

...dscape { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.sc...

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

399. 骨骼动画进阶(JavaScript-2D进阶篇(JS)-动画进阶) [ 84%]

...皮肤 skeleton0.showSkinByIndex(1); //播放 skeleton0.play(0,true); Laya.stage.addChild(skeleton0); //创建第二个动画 var skeleton1; skeleton1=templet.buildArmature(0); skeleton1.pos(500,700); skeleton1.showSkinByIndex(1); skeleton1.play(0,true); Laya.stage.addChild(skeleton1); } ``` **二...

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

400. 显卡驱动停止响应,且大概率蓝屏,原来是Handler惹的祸,但原因是什么 [ 84%]

...ded方法会无限循环执行   testlaya.aspackage { import laya.display.Stage; import laya.webgl.WebGL; public class testlaya { public function testlaya() { Laya.init(100, 100, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.bgColor = "#ffffff"; ...

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