当前位置:网站首页>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 !!!!
边栏推荐
- [original] all management without assessment is nonsense!
- 使用Scrapy框架爬取网页并保存到Mysql的实现
- 全日制研究生和非全日制研究生的区别!
- Pit avoidance: description of null values in in and not in SQL
- 【兰州大学】考研初试复试资料分享
- Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
- The difference between full-time graduate students and part-time graduate students!
- Ctfshow, information collection: web6
- 【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
- CTFshow,信息搜集:web5
猜你喜欢

HPDC smart base Talent Development Summit essay

Ctfshow, information collection: web7

Ctfshow, information collection: web4

【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)

“百度杯”CTF比赛 2017 二月场,Web:include
![Super signature principle (fully automated super signature) [Yun Xiaoduo]](/img/b8/5bafbada054b335568e64c7e1ac6bb.jpg)
Super signature principle (fully automated super signature) [Yun Xiaoduo]
![[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)](/img/7e/188e57ee026200478a6f61eb507c92.png)
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)

Change win10 Screensaver

什么是数据泄露

Create lib Library in keil and use lib Library
随机推荐
#HPDC智能基座人才发展峰会随笔
【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
[target detection] yolov5 Runtong voc2007 data set
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
Use cpolar to build a business website (2)
CTFshow,信息搜集:web6
Basic knowledge sorting of mongodb database
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
What is data leakage
从 1.5 开始搭建一个微服务框架链路追踪 traceId
2022年5月互联网医疗领域月度观察
Ctfshow, information collection: Web3
Keil5 does not support online simulation of STM32 F0 series
Oracle control file loss recovery archive mode method
CTFshow,信息搜集:web2
CTFshow,信息搜集:web4
Bits and Information & integer notes
【目标检测】YOLOv5跑通VOC2007数据集
Ctfshow, information collection: web14
什么是pv和uv? pv、uv