Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

GUILayout custom styles

Discussion in 'Immediate Mode GUI (IMGUI)' started by monark, Aug 4, 2008.

  1. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    How do you apply custom or unity styles to GUILayout?

    The help goes into some detail on how to do it just with GUI but doesn't mention it (or I can't find it) for GUILayout.

    So say I want a GUILayout.Toggle but as a button style, how do you do that?
     
  2. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
    Hi monark

    I think, that is what you're looking for:
    http://unity3d.com/support/documentation/Components/gui-Customization.html

    In the middle of the page you can find "Working with Styles".

    Last line of the following code should / could help you.
    Code (csharp):
    1. // Make a button that uses the "toggle" GUIStyle
    2. GUI.Button (Rect (10,140,180,20), "This is a button", "toggle");
    Alex
     
  3. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Yeah that's the bit i know about but that works only with GUI, it's specifically GUILayout that I'm now wondering about.
     
  4. alexander

    alexander

    Joined:
    Mar 28, 2008
    Posts:
    180
  5. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598