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

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

1. setSubPixels画布擦除不掉 [ 100%]

...0; this._testStatus = !this._testStatus; // let canvasInfo = this.getCanvasWidthHeight(); let ctx = new Laya.Context(); // let w = canvasInfo.w//tex.width; // let h = canvasInfo.h//tex.height; let w = tex.width; let h = tex.height; ctx.size(w,h); ctx.asBitmap = true; // ctx.clearRect(0,0,w,h); let _...

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

2. Laya.loader.load(xx) 当地址""的时候,会报错。 [ 96%]

...D)) {                     tex = new Texture2D(data.width, data.height, 1, false, false);                     tex.wrapModeU = exports.WarpMode.Clamp;                     tex.wrapModeV = exports.WarpMode.Clamp;          ...

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

3. 在安卓手机上drawToTexture不能正确返回纹理对象,是HTMLCanvas [ 91%]

...exture = Laya.Sprite.drawToTexture(dragCom,Laya.SpriteConst.TEXTURE,bounds.width, bounds.height, -bounds.x + view.x, -bounds.y + view.y); this._agent.graphics.drawTexture(this._agentTexture, (this._agent.width - bounds.width) * 0.5, (this._agent.height - bounds.height) * 0.5);   }   附件 : --> 2...

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

4. 引擎 TiledMap 居然不支持图块翻转 [ 87%]

...                if (this.x < 0 || this.x > this._map.viewPortWidth || this.y < 0 || this.y > this._map.viewPortHeight) {                     this.hide();                 }                 else {                     this.show();           ...

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

5. 帮忙看看Texture类getPixels内存泄漏的问题。 [ 86%]

...(_colorTex); _colorSpr.cacheAs = "bitmap"; _colorSpr.pos((1024 - _colorTex.width) >> 1, (768 - _colorTex.height) >> 1); _colorSpr.size(_colorTex.width, _colorTex.height); Laya.stage.addChild(_colorSpr); _initPixelCount = getPixel(_colorTex); addEvent(); } private function addEvent():void...

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

6. Uint8Array的像素数据在ios中无法改变图片纹理,安卓正常 [ 85%]

...testSetPixels() { let data = this.test1.texture.getPixels(0, 0, this.test1.width, this.test1.height); let width = this.test1.width; let height = data.length / 4 / width; let tex2d = new Laya.Texture2D(width, height, 1); tex2d.setPixels(data); this.imgAr.texture.setTo(tex2d); } 附件 : --> demo.zip ...

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

7. htmlCanvas 像素级操作 [ 83%]

...); //获取临时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

8. 画了一个封闭的曲线,获取鼠标点击处的像素,为何坐标对不上导致拿不到正确位置的Texture? [ 82%]

....mouseX, _view.stage.mouseY); var tex:Texture = new Texture(hc); trace(tex.width + "---" + tex.height + "---" + getPixel(tex)); /*获取所画曲线鼠标点击处的像素,为何坐标对不上? 导致无法拿到正确位置的Texture*/ /*var spr:Sprite = new Sprite(); spr.graphics.drawTexture...

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

9. 新人求教!!! [ 81%]

...ics.drawTexture(texture);   //设置纹理宽高   this.img.size(texture.width, texture.height); <!--  我想把加粗部分换成  this.img.graphics.drawTexture(Laya.loader.getRes(imgUrl),100,50,60,60);   为什么就不起作用了,switchImg()只执行了一次,不能实现切换图片 ...

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

10. Texture2D.setPixels会导致图片质量变差了,获取原生的pixels没有进行改动。怎么回事呢? [ 80%]

...Obj = this; var onload=function (){ var tex=new Laya.Texture2D(imageSource.width,imageSource.height,1,false,true); tex.wrapModeU=1; tex.wrapModeV=1; tex.loadImageSource(imageSource,true); tex._setCreateURL(url); var tex2=new Laya.Texture(tex); tex2.url=url;   var image:Laya.Image = new Laya.Image()...

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