- Home /
Similar function in UI for GUILayoutUtility.GetRect
I've been struggling some time changing the dialogue system for my old-school graphic adventure from GUI to UI. Especially finding a method that could do the same as:
GUILayoutUtility.GetRect(new GUIContent("some text"), guiStyle)
I use it for getting the rect width before attaching the text to the UI Text component, so I can change the position of the text in case it surpasses the screen border. However, I needed to change to UI and I can't find any method or component that does the same in UI.
Is there any possibility of obtaining that rect before attaching the text, or just using other components/methods so the text never surpasses the screen border?
Your answer
Follow this Question
Related Questions
In-game text editor, native or NGUI 2 Answers
Does GUIStyle.CalcSize harm the performance? 1 Answer
Force Unity UI element to refresh/update? 4 Answers
UI Text changing size? really confused 0 Answers
Can't drag object references!! 1 Answer