java subpixel,Laya使用setsubpixel函数对图片进行纹理像素填充,安卓端微信不正常...

Laya使用setsubpixel函数对图片进行纹理像素填充,安卓端微信不正常

游戏引擎 AppID 操作系统 微信版本 基础库版本 LAYABOX wxf7f715623d0654df Android 7.0.15 2.11.3

如图,都是独立的png图片,一个大图填充一个小图的像素信息,pc,ios端微信,ios浏览器,安卓浏览器都是 正常的,唯独安卓端的微信小游戏不正常,会显示成不正常的纹理,有没有人知道是什么情况呢

不知道是否与填充图的纹理格式有关,以下是测试的关键代码:

//生成填充用的图片

urls.push({ url: ResourcesManager.inst.brush_test_green, clas:

Laya.Loader.TEXTURE2D,constructParams:[100, 100, 1, false, true]});

//开始填充

public fillPlane(){

let brush = Laya.loader.getRes(ResourcesManager.inst.brush_test_green) as Laya.Texture2D;

let originTexture = this.plane['_render']['material']['albedoTexture'] as Laya.Texture2D;

originTexture.setSubPixels(256,256,brush.width,brush.height,brush.getPixels());

}

7a63456a720235d8aa92d72c6dc138b9.png

Game engine appid operating system wechat version basic library version layabox wxf7f715623d0654df Android 7.0.15 2.11.3 as shown in the figure, all are independent PNG images. A large image fills in the pixel information of a small image. PC, IOS end wechat, IOS browser and Android browser are all Normally, only the Android wechat games are abnormal, which will display abnormal texture. Does anyone know what the situation is? I don't know whether it is related to the texture format of the filling image. The following is the key code for the test: / / generate the image for filling urls.push ({ url: ResourcesManager.inst.brush_ test_ green, clas: Laya.Loader.TEXTURE2D , constructparams: [100, 100, 1, false, true]}); / / start filling public fillplane() {let brush= Laya.loader.getRes ( ResourcesManager.inst.brush_ test_ green) as Laya.Texture2D ; let originTexture = this.plane [] render']['material']['albedoTexture'] as Laya.Texture2D ; originTexture.setSubPixels (256,256, brush.width , brush.height , brush.getPixels ()); }

回答:

小游戏运营专员-宏:

你好,可以先去laya社区反馈一下这个问题。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值