I'm using GUILayout for my GUI content, and I'd like to set horizontal alignment centered...
But my content is made of pic, buttons and vertical slider, no text !
How can I set the horizontal alignement ?
My code looks like this :
GUILayout.BeginArea(new Rect(...)); GUILayout.BeginVertical();
myslidervalue = GUILayout.Slider(myslidervalue, ...);
I've tried to set a GUIStyle in the BeginArea or BeginVertical with TextAnchor.MiddleCenter but it doesn't seem to set it for any other content than text...
Thanks for helping me !
asked Jun 06 '11 at 09:16 AM
you can rotate your gui, maybe this helps :
when you want to seperate these from the other gui you can use a GUIMatrix :
answered Jun 06 '11 at 09:28 AM
Thanks for the rotation tip, but I found my own answer !
I've found the GUILayout.FlexibleSpace(), mixed with a Begin/EndHorizontal(), this makes auto center, like CSS.
answered Jun 06 '11 at 01:11 PM