Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  3. Unity 2017.2 is now released.
    Dismiss Notice
  4. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  5. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  7. Unity 2017.3 beta is now available for download.
    Dismiss Notice

GUIstyle

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

  1. lesfundi

    lesfundi

    Joined:
    Jan 10, 2009
    Posts:
    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
    Posts:
    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
    Posts:
    628
    sorry for my stupid question but how to you define the placement of the button than?
     
  4. Quietus2

    Quietus2

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

    lesfundi

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

    Jerware

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

    Josh707

    Joined:
    Jul 12, 2012
    Posts:
    65
    Thanks Jerware