当前位置:网站首页>Cocos uses custom material to display problems
Cocos uses custom material to display problems
2022-07-07 15:38:00 【Vegetable chicken on the road】
The boss of the company just talked to me many times about this problem , But I didn't pay attention when I used it , Just record it !
problem : Pictures are customized material The image texture is not fully displayed after clipping
Desired effect : The avatar is downloaded from the remote server and cut into rounded corners for display 
The effect :
In the process of searching, I found that it was replaced by cocos Self contained material There's no problem , Once thought I wrote it myself material Problems arise , In fact, I learned later that the default material does not operate on the image texture , So it's okay .
Then look up the code and find it packable Change it to false Just fine .. It's too much .
Part of the code is as follows :
loadHeadImg(){
// Download pictures from a remote server
this.loadRemoteRes(UserModel.inst.getAvatar(),(error,Texture2D:cc.Texture2D)=>{
Texture2D.packable = false;
var sprite = new cc.SpriteFrame(Texture2D);
this._headImg.push(sprite);
})
}
What the official documents say is clear .. Stick the :
So you'd better read the official documents when you're free !!!!
边栏推荐
- 2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
- 【深度学习】语义分割实验:Unet网络/MSRC2数据集
- 【OBS】RTMPSockBuf_Fill, remote host closed connection.
- Keil5 does not support online simulation of STM32 F0 series
- CTFshow,信息搜集:web6
- How to release NFT in batches in opensea (rinkeby test network)
- Jacobo code coverage
- Wechat applet 01
- 【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
- Configure mongodb database in window environment
猜你喜欢

使用cpolar建立一个商业网站(2)

什么是数据泄露

Ctfshow, information collection: web12

Briefly describe the working principle of kept

【深度学习】图像超分实验:SRCNN/FSRCNN

【兰州大学】考研初试复试资料分享

MySQL bit type resolution

2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code

【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)

Keil5 does not support online simulation of STM32 F0 series
随机推荐
Ctfshow, information collection: web14
【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
Configure mongodb database in window environment
Ctfshow, information collection: web10
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
MongoDB数据库基础知识整理
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
What are PV and UV? pv、uv
Bye, Dachang! I'm going to the factory today
微信小程序 01
Integer learning
TypeScript 发布 4.8 beta 版本
从 1.5 开始搭建一个微服务框架链路追踪 traceId
Basic knowledge sorting of mongodb database
STM32F103C8T6 PWM驱动舵机(SG90)
Unity之ASE实现卡通火焰
"Baidu Cup" CTF competition 2017 February, web:include
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
Nacos conformance protocol cp/ap/jraft/distro protocol
[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)