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

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

441. typescipt在一定范围内加载图片按照等比排列 [ 79%]

...min是右边的效果             let ratio = Math.max(source.width, source.height) / 100;             img.width = source.width / ratio;             img.height = source.height / ratio;         }     }     reset();     img.on(Laya.Event.LOADED, ...

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

442. 关于屏幕适配的问题(急) [ 79%]

...是通过宽度来缩放, Laya.stage.scaleMode = Laya.Stage.SCALE_FIXED_WIDTH;那就是我只要动态设计panel的宽高即可,但是直接把当前屏幕 Laya.Browser.height赋值给panel的高是不行的,还得*1336/Laya.Browser.width才能做到,想知道这是为什么,我发现Laya...

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

443. 照着官方文档写的 Dialog 报错? [ 79%]

...e.png"); button.size(50, 50); button.name = Dialog.CLOSE; button.pos(bgImg.width - button.width - 5, 5); dialog.addChild(button); dialog.dragArea = "0,0," + bgImg.width + "," + bgImg.height; dialog.show(); }; } Laya.class(LoadResource, "LoadResource", null);照着官方文档实例, 写了一个...

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

444. Texture.getPixels在手机真机Native环境中会报错 [ 79%]

...发报错!因为是必现所以没有提供DEMO了   getPixels(x, y, width, height) {             if (window.conch) {                 return this._nativeObj.getImageData(x, y, width, height); //this._nativeObj为空!             }       ...

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

445. 仿照laya官方demo做了一个视频播放的UI,为啥在微信里不能用? [ 78%]

....stage.addChild(reference); reference.pos(0, 0); reference.size(Laya.stage.width, Laya.stage.height); reference.graphics.drawRect(0, 0, reference.width, reference.height, "#CCCCCC"); let tipElmt = Laya.Browser.createElement("img"); tipElmt.src = getResURI("ui/guide_tip.png"); tipElmt.style.zInddex =...

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

446. 【解决】富文本html下划线换行bug [ 78%]

...; graphic.drawLine(words[0].x,firstlineY,words[slsIndex].x+words[slsIndex].width,firstlineY,color,1); let secondLineY = words[slsIndex+1].y + words[slsIndex+1].height; graphic.drawLine(words[slsIndex+1].x,secondLineY,lastWords.x+lastWords.width,secondLineY,color,1); }else{ graphic.drawLine(words[0]....

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

447. 关于微信小游戏关系链的问题 [ 78%]

... LayaUISample.scoreview.graphics.drawTexture(rankTexture,5,78,rankTexture.width,rankTexture.height);     }); var rankTexture=new Texture(Browser.window.sharedCanvas); 这里报错 VM13215:1 gameThirdScriptError bitmap._addReference is not a function TypeError: bitmap._addReference is not a func...

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

448. laya.utils.Utils [ 78%]

...itDOMElementInArea(dom:Object, coordinateSpace:Sprite, x:Number, y:Number, width:Number, height:Number):void[static] 使DOM元素使用舞台内的某块区域内。 Utils  getGID():int[static] 获取一个全局唯一ID。Utils  getGlobalPosAndScale(sprite:Sprite):Rectangle[static] 计算传入...

来源: laya_api 发布时间: 20170929

449. 区块地图-PerspectiveWall [ 78%]

...eMap("res/tiledMap/perspective_walls.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), null); } } new TiledMap_PerspectiveWall();module laya { import Stage = Laya.Stage; import TiledMap = Laya.TiledMap; import Rectangle = Laya.Rectangle; import Browser = Laya.Browser; import WebGL = L...

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

450. htmlCanvas 像素级操作 [ 78%]

...); //获取临时sprite的htmlCanvas var htmlCanvas = img.drawToCanvas(tex.width,tex.height,0,0); //获取临时sprite的 原生Canvas var c = htmlCanvas.getCanvas(); var ctx = c.getContext("2d"); //获取canvas的imgData var imgData = ctx.getImageData(0,0,ctx.canvas.width,ctx.canvas.height); //将...

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