Resize UI Panel to the same size as its parent Canvas through code
Hey Unity Pros,
So I've been struggling with this for the last 2 days and still nothing.
I have a panel which is anchored on the bottom of the canvas with the pivot. Now because this is anchored on the bottom that means the panel wont resize itself to other aspect ratios and screen sizes (only on the x axis i guess because of the anchores). I use the pivot to lerp the panel in and out. This is why i cant use full screen anchoring because than i have to use pixels to move my panel which means its probably not gonna work on other types of screens because resolutions.
Maybe one solution could be that we get the size of the canvas at the beginning and apply that to the panel but idk...
Please guys, i would greatly appreciate it if you could help me in this!
Thank you!
Your answer
Follow this Question
Related Questions
RectTransform.anchoredPosition changes, but element is not visually updated 1 Answer
Button becomes unclickable if it is in the panel 0 Answers
How to tell if a RectTransform is within the visible area of a ScrollRect 1 Answer
How to offset a RectTransform? 0 Answers
[SOLVED] Image is not visible in Panel (in game view) 0 Answers