playMaker

Author Topic: GUI Position [SOLVED]  (Read 5299 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
GUI Position [SOLVED]
« 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! :)
« Last Edit: September 11, 2013, 06:28:59 PM by Alex Chouls »
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: GUI Position
« Reply #1 on: September 11, 2013, 05:46:01 AM »
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

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: GUI Position
« Reply #2 on: September 11, 2013, 09:04:58 AM »
Ok, but how can I create a GUIskin?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: GUI Position
« Reply #3 on: September 11, 2013, 09:08:29 AM »
Assets>Create>GUI Skin
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: GUI Position
« Reply #4 on: September 11, 2013, 09:21:21 AM »
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?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: GUI Position
« Reply #5 on: September 11, 2013, 09:29:07 AM »
If you Begin a GUI Layout Area then you have to end it with GUI Layout End Area
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: GUI Position
« Reply #6 on: September 11, 2013, 09:31:47 AM »
Yes, I found it out :-)

I will just try to experiment a little bit at my own, but maybe I need more help. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: GUI Position
« Reply #7 on: September 11, 2013, 09:44:25 AM »
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?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: GUI Position
« Reply #8 on: September 11, 2013, 10:33:29 AM »
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.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: GUI Position
« Reply #9 on: September 11, 2013, 03:32:16 PM »
Yes, that's right! The GUILayout Int Label was not between the Begin and End Layout! Now everything is working!
Thanks! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no