Resize the Texture2D to fit the renderer size
I am trying make a 2D card game. To dispense the cards, I need to create the cards of the right size, which needs to be calibrated. I need help in scaling the Texture2D to fit the renderer size, which I'd like to be 200x400px. This is the code I have now:
But when the code is executed, the sprite is still of the original size (1080x1920). How can I assign the sprite the Texture2D with size 1080x1920px and scale it down to 200x400?
Your answer
![](https://koobas.hobune.stream/wayback/20220613051159im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
PNG loaded from disk works in UI Image, but not in SpriteRenderer? 0 Answers
resizing texturerect on update of animated 2D sprite 0 Answers
How to change the scaling of a enemy on instantiate 0 Answers
Scaling animation that takes rotation into account 0 Answers
How do i make a character selection menu (2d game) ? 2 Answers