当前位置:网站首页>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 !!!!
边栏推荐
- CTFshow,信息搜集:web6
- 写一篇万字长文《CAS自旋锁》送杰伦的新专辑登顶热榜
- [quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)
- Niuke real problem programming - day20
- 从 1.5 开始搭建一个微服务框架链路追踪 traceId
- The download button and debug button in keil are grayed out
- 【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
- 【OBS】RTMPSockBuf_Fill, remote host closed connection.
- How to deploy the super signature distribution platform system?
- 最安全的证券交易app都有哪些
猜你喜欢

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

微信小程序 01
![[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code](/img/8d/a6d477a8679ca4f3885b1a7b542437.png)
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code

The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service

How to release NFT in batches in opensea (rinkeby test network)

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

【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例

【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
![[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)](/img/d3/cab8a1cba3c8d8107ce4a95f328d36.png)
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
![[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)](/img/e9/9e32e38e12e1fa71732c52b8ee0ab0.png)
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
随机推荐
写一篇万字长文《CAS自旋锁》送杰伦的新专辑登顶热榜
Pit avoidance: description of null values in in and not in SQL
[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
Configure mongodb database in window environment
一个需求温习到的所有知识,h5的表单被键盘遮挡,事件代理,事件委托
What are PV and UV? pv、uv
最安全的证券交易app都有哪些
【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
[markdown grammar advanced] make your blog more exciting (IV: set font style and color comparison table)
Starting from 1.5, build a microservice framework link tracking traceid
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
Integer learning
[data mining] visual pattern mining: hog feature + cosine similarity /k-means clustering
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
知否|两大风控最重要指标与客群好坏的关系分析
How to build your own super signature system (yunxiaoduo)?
【搞船日记】【Shapr3D的STL格式转Gcode】
MySQL bit类型解析
Android -- jetpack: the difference between livedata setValue and postvalue