How do I gradually change a UI element's size over time during runtime?
I've got a menu of various items players can purchase and I want the price tabs to shrink down to nothingness before being deleted. Everything I've found regarding gradually changing the sizes of an object during runtime seem to be aimed at actual in-game objects rather than UI elements. I'm assuming localeScale doesn't work for UI elements because while I'm not getting an error for that code, it's not working either. Any help would be much appreciated.
Answer by CoryButler · Jul 14, 2017 at 12:40 PM
Look into RectTransform.sizeDelta. You can use the Update method or a coroutine to update its x value — I assume you want to shrink the tab horizontally. SizeDetla behaves differently depending on how you have anchored the UI element.
Your answer
Follow this Question
Related Questions
How can I resize an image with drag-and-drop? 0 Answers
Updating Property of Custom UI Image Material at Runtime 0 Answers
Change skin on runtime 1 Answer
choose texture option when lookat 0 Answers
Runtime Normal Map Import Issues 1 Answer