当前位置:网站首页>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 !!!!
边栏推荐
- The download button and debug button in keil are grayed out
- 从 1.5 开始搭建一个微服务框架链路追踪 traceId
- 【OBS】RTMPSockBuf_Fill, remote host closed connection.
- Ctfshow, information collection: web9
- Wechat applet 01
- MongoDB数据库基础知识整理
- 【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
- 【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
- Ctfshow, information collection: web2
- [understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
猜你喜欢
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
Ctfshow, information collection: web5
[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
从 1.5 开始搭建一个微服务框架链路追踪 traceId
Why do we use UTF-8 encoding?
Unity之ASE实现全屏风沙效果
CTFshow,信息搜集:web4
【数字IC验证快速入门】24、SystemVerilog项目实践之AHB-SRAMC(4)(AHB继续深入)
数学建模——什么是数学建模
随机推荐
MySQL bit类型解析
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
【目标检测】YOLOv5跑通VOC2007数据集
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
What are the safest securities trading apps
使用Scrapy框架爬取网页并保存到Mysql的实现
Ctfshow, information collection: web6
[understanding of opportunity -40]: direction, rules, choice, effort, fairness, cognition, ability, action, read the five layers of perception of 3GPP 6G white paper
Mathematical modeling -- what is mathematical modeling
[quick start of Digital IC Verification] 24. AHB sramc of SystemVerilog project practice (4) (AHB continues to deepen)
Wechat applet 01
Change win10 Screensaver
Android -- jetpack: the difference between livedata setValue and postvalue
HW primary flow monitoring, what should we do
[quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)
Whether runnable can be interrupted
leetcode 241. Different Ways to Add Parentheses 为运算表达式设计优先级(中等)
Qu'est - ce qu'une violation de données
Ctfshow, information collection: web12
Excerpted words