当前位置:网站首页>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 !!!!
边栏推荐
- 使用Scrapy框架爬取网页并保存到Mysql的实现
- A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
- @Introduction and three usages of controlleradvice
- CTFshow,信息搜集:web2
- What are the safest securities trading apps
- 【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
- 摘抄的只言片语
- Whether runnable can be interrupted
- Qu'est - ce qu'une violation de données
- [follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
猜你喜欢
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
Ctfshow, information collection: web9
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
【兰州大学】考研初试复试资料分享
Wechat applet 01
全日制研究生和非全日制研究生的区别!
Mathematical modeling -- what is mathematical modeling
The difference between full-time graduate students and part-time graduate students!
[target detection] yolov5 Runtong voc2007 data set
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
随机推荐
知否|两大风控最重要指标与客群好坏的关系分析
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
Unity之ASE实现全屏风沙效果
【原创】一切不谈考核的管理都是扯淡!
Keil5 does not support online simulation of STM32 F0 series
2. Basic knowledge of golang
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
Ctfshow, information collection: web8
【OBS】RTMPSockBuf_Fill, remote host closed connection.
Steps to create P8 certificate and warehousing account
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
Ctfshow, information collection: web9
What is Base64?
The download button and debug button in keil are grayed out
【目标检测】YOLOv5跑通VOC2007数据集
【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
Bye, Dachang! I'm going to the factory today
【搞船日记】【Shapr3D的STL格式转Gcode】