How to fit a picture into a background GameObject
Hi guys!
I have the following Situation: I have a parent called "WildCard" with two children: An Image stored in an GameObject called "Image" And a background GameObject called Background. The finished thing looks like that.
My goal: I would like to adjust the Background's size to fit the picture (while preserving the image aspect) . I've tried lots of things. (ContentFitter and so on) I have set the "Preserve Aspect" variable to true, which of course works fine. But i cant increase the Backgrounds size to fit the picture...The parent of the WildCards allready has a verticalLayoutGroup for all the other WildCards. So the Wildcards Width is fix but not their height.
My Question I would like to find a way to resize the background so that it wraps around the picture nicely... I am quite shure that there is a nice way to do it... Could you guys help me to do that or give me some hints?
As you can see, the picture is taller than the white background.
Thank you!
PS: This is my first post. So please be gentle regarding mistakes of any kind.
Your answer
Follow this Question
Related Questions
Layout Group with Content Fitter? 0 Answers
Inconsistent UI canvas rendering on UI, in scene mode and game mode, and during game mode 0 Answers
2D: Size of the background sprite? 0 Answers
2D image as background for game with a resize-able window 0 Answers
Content Size Fitter doesnt work :( 0 Answers