当前位置:网站首页>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 !!!!
边栏推荐
- 连接ftp服务器教程
- Compile advanced notes
- Ctfshow, information collection: web9
- Unity's ASE achieves full screen sand blowing effect
- Win10 or win11 taskbar, automatically hidden and transparent
- [Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
- Ctfshow, information collection: web10
- 2. Heap sort "hard to understand sort"
- 【数字IC验证快速入门】26、SystemVerilog项目实践之AHB-SRAMC(6)(APB协议基本要点)
- 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
猜你喜欢
Ctfshow, information collection: web7
使用Scrapy框架爬取网页并保存到Mysql的实现
"Baidu Cup" CTF competition 2017 February, web:include
银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级
Ctfshow, information collection: web4
[机缘参悟-40]:方向、规则、选择、努力、公平、认知、能力、行动,读3GPP 6G白皮书的五层感悟
Implementation of crawling web pages and saving them to MySQL using the scrapy framework
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
2. Heap sort "hard to understand sort"
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
随机推荐
数学建模——什么是数学建模
Basic knowledge sorting of mongodb database
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
[deep learning] image hyperspectral experiment: srcnn/fsrcnn
[Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
Do you know the relationship between the most important indicators of two strong wind control and the quality of the customer base
CTFshow,信息搜集:web4
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
居然从408改考自命题!211华北电力大学(北京)
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
Comparable and comparator of sorting
Guangzhou Development Zone enables geographical indication products to help rural revitalization
Write a ten thousand word long article "CAS spin lock" to send Jay's new album to the top of the hot list
Nacos conformance protocol cp/ap/jraft/distro protocol
连接ftp服务器教程
Connecting FTP server tutorial
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
简述keepalived工作原理
[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)