|
Hi, I'm using the following:
What would I set it to for it to be centered on the screen instead of the left corner?
(comments are locked)
|
|
You need a GUIStyle that has a centered alignment. You can do this programmatically by getting an existing style and setting the alignment:
Or you can make your own style, set it up in the inspector to include centering, and use that: Is it just me, or does this solution not seem to work? That alignment property seems to have no bearing on GUI being centered on the screen.
Dec 10 '12 at 09:27 PM
Brenden Frank
Useful code :)
Jan 10 at 09:49 AM
sona.viswam
thx just what i needed
Apr 24 at 10:56 AM
Poulpc
(comments are locked)
|
|
hey there again! here's the code to do that:
and if it's not centered, play around with the window height / width, and if it's still not working, let me know. the other var and script i'm talking about is from this person's other question: http://answers.unity3d.com/questions/30742/gui-message-box
Dec 08 '10 at 02:12 AM
Jesus_Freak
i was aiming taht at anyone that might see this later besides you, RSunity
Dec 08 '10 at 02:12 AM
Jesus_Freak
I was employing this solution until I started using Matrix4x4 to scale my GUI based on screen resolution. The sizing works, however the offset values don't seem to want to comply.
Dec 10 '12 at 09:28 PM
Brenden Frank
(comments are locked)
|
