playMaker

Author Topic: Center GUI Label Horizontally  (Read 1932 times)

ConnersCraft

  • Playmaker Newbie
  • *
  • Posts: 4
Center GUI Label Horizontally
« on: July 19, 2013, 09:51:29 PM »
I am creating the main menu for my new game. The title of the game appears at the top. How can I make a GUI label stay centered horizontally no matter what screen size the user has? Also as a side question, I have some GUI buttons. What value should be put in the "left" field to keep these centered? Thanks for the help.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Center GUI Label Horizontally
« Reply #1 on: July 28, 2013, 01:04:03 PM »
Hi,

 create an horizontal area ( guiLayoutStartHorizontal), add a flexible space before and after the label and done.

 the other way is to create a custom gui skin and define the centering in the custom skin itself, it's definitly cleaner this way if you plan on doing this in various places.

bye,

 Jean