- Home /
Question by
tribski · Sep 23, 2016 at 11:41 AM ·
transformsizestartrecttransform
How to get size of dynamically created layout element
I create buttons from prefabs and add those prefabs to the "Button container" element. Both of them are Layout elements, and have width and height that's changing. The problem is that upon calling the start() function their recttransform.sizeDelta is set to 0,0. That being said I know that their size is set properly during the first update() event. But I don't want to do this in update as it would be very inefficient. So the questions are - when is the layout of UI elements calculated (their size etc.), and when can I access it?
Comment
Your answer
Follow this Question
Related Questions
how to change sphere/capsule collider, it sizes and the center 2 Answers
Scale script don´t work 0 Answers
RectTransform rounding? 0 Answers