1. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
  2. Enter the Google Play Indie Games Contest in Europe. Read more about it here.
  3. Unity 5.5 is now released.
  4. Become a closed-alpha partner on the new Facebook games platform. Read more about it here.
  5. Get early access to our Google Daydream Technical preview. Click here for more details!

GUIstyle

Discussion in 'Extensions & OnGUI' started by lesfundi, Jan 3, 2010.

  1. lesfundi

    lesfundi

    Joined:
    Jan 10, 2009
    Messages:
    628
    i understand GUIskin but not GUIstyle.
    Where can i see some example script with this?
    I want to create custom buttons, that is it.

    I checked out this movie file but screen size it is too small to see it.
    http://vimeo.com/channels/ncsuunity#6067691

    thanks,
    fundi
     
  2. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Messages:
    2,061
    They are quite simple to work with. Simply define it as you would any other variable you expose for the inspector.

    Code (csharp):
    1. var myButtonStyle : GUIStyle;
    Change the attributes as you wish for you new button in the inspector, then reference that style for your button in code where applicable.

    Code (csharp):
    1. GUILayout.Button("Press: ", myButtonStyle );
     
  3. lesfundi

    lesfundi

    Joined:
    Jan 10, 2009
    Messages:
    628
    sorry for my stupid question but how to you define the placement of the button than?
     
  4. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Messages:
    2,061
  5. lesfundi

    lesfundi

    Joined:
    Jan 10, 2009
    Messages:
    628
    THANKS!
     
  6. Jerware

    Jerware

    Joined:
    May 15, 2012
    Messages:
    41
  7. Josh707

    Josh707

    Joined:
    Jul 12, 2012
    Messages:
    65
    Thanks Jerware