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

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:00 1695 0 全屏看文

AI助手支持GPT4.0

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());


    }

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社区反馈一下这个问题。

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
初始化微信激励广告组件会掉帧?
打款失败?原因:参数错误:用户openid字段必填,并且少于32个字符.
APP支付服务商模式报支付验证签名失败
微信小游戏使用wx.addCard()领取卡券功能,报errMsg: "addCard:fail?
企业微信小程序附件使用qq浏览器打开报错
随便看看
微信公众号openid? 2347
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048
如何快速搭建抽奖助手小程序(无需代码知识) 6177