- Home /
Question by
Payaso_Prince · Aug 09, 2020 at 10:47 PM ·
menubattle-systemturnbased
A menu that gets longer depending on the amount of skills you have?
Hello All!
Currently I have an attack button that will gather all of a hero's learned skills when it is pressed.
What I want to do is display the skill names in a list and have the background image extend based on how many skills are being displayed. What is the best way to go about doing this? Here is an example of what i'm trying to achieve.
menu-example.png
(420.1 kB)
Comment
Answer by GoldenretriverYT · Aug 10, 2020 at 02:02 AM
I am not totally sure, but try this.
myAwesomeSkillsHolder.GetComponent<RectTransform>().sizeDelta = new Vector2(0, myAwesomeSkillsHolder.transform.childCount * <insert size of skill ui-component>);
myAwesomeSkillsHolder should be a object (the background-sprite for example), that holds all Skill-UI-Components (as children)