I’m in need of resizing a GUILayout-based window (for mobile). Basically the user can choose small/medium/large UI depending on their device’s needs. (I change font and some other element sizes). The window needs to auto-calculate itself to fit itself to the new sizes.
I’ve been doing this by setting the window rect to something small (like 20x20) so that the next OnGUI will recalculate it. Which it does. Now the problem:
For one frame, I get a small window. The next frame repaints with a nice window size, but this flash is pretty annoying.
What’s the best way to tell a GUILayout window to recalculate itself without getting this type of flash?