Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on September 11, 2013, 04:12:40 AM
-
Hi!
How can I position a GUILayout Int Label?
It's always placed on the top/left screen.
I want it to be placed on a cube at the
center/bottom of the screen. How can I do that?
Thanks! :)
-
Hi,
for this, you need several things:
1: Create a guiskin
2: modify the label entry
-- alignment: MiddleCenter
-- Stretch Width: true
-- Stretch Height: true
3: set this skin for your state using action "set Gui Skin"
4: using the action GUILayoutBeginAreaFollowObject to have your gui follow an object
5: set the area of this action above like so
Offset Left: -100
Offset Top:100
Width : 200
Height : 200
Normalized : False
3: add your label inside this area
and you will have a perfectly centered label on top of your object.
Bye,
Jean
-
Ok, but how can I create a GUIskin?
-
Assets>Create>GUI Skin
-
Thanks Lane!
But I get this error:
"GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)"
I use this two actions in the same state!
-Set GUI Skin
-GUILayout Begin Area Follow Object
I tried to disable Set GUI Skin. The error disappeared.
So it need to be something with the Set GUI Skin
What do I wrong?
-
If you Begin a GUI Layout Area then you have to end it with GUI Layout End Area
-
Yes, I found it out :-)
I will just try to experiment a little bit at my own, but maybe I need more help. :)
-
Ok, I made a GUI Label which is is placed in the middle of the screen. But not on the Cube.
But What about GUILayout Int Label. I have that in the same State, but this is placed in the upper left corner of the screen. Is it possible to change the position of this?
-
The GUI actions you put between the Begin and End Layout actions will follow the Layout area. If the Layout Begin is following something, its sub-actions should also follow it.
-
Yes, that's right! The GUILayout Int Label was not between the Begin and End Layout! Now everything is working!
Thanks! :)