Unity Community


Results 1 to 6 of 6

Thread: About Guistyle


  1. Posts
    50

    About Guistyle

    Hi guys
    I found one argument in gui.box and gui.label or gui.something

    What does guistyle really mean and how can i create and define it?

    B.T.W:Is any default guistyle I can try?

  2. Unity tech writer

    Location
    Blackpool, United Kingdom
    Posts
    8,696
    A GUIStyle is a way to supply extra information to the GUI functions to specify how the control should be displayed. You can instantiate them directly in code and set their fields, but the easiest way to use GUIStyles is with a GUISkin. See this manual page for more information on how to use styles and skins.
    I'm wired to the world... that's how I... know... everything...


  3. Posts
    111
    The GUI Customization Manual page says, "As stated earlier, GUISkins are a collection of GUIStyles. Styles define the appearance of a GUI Control. You do not have to use a Skin if you want to use a Style." And the picture shows a Custom GuiStyle object directly under a GUIScript.

    This, to me, implies that I can create a Style as a separate object, in the Editor. Is that true or not? I don't see the option in Assets->Create, or anywhere else. Or does that mean you can procedurally (only) create a Style?

    John C>
    "For all your days, prepare, and meet them ever alike;
    When you are the anvil, bear - when the hammer, strike."

  4. Unity tech writer

    Location
    Blackpool, United Kingdom
    Posts
    8,696
    There isn't a GUIStyle asset type, so you do indeed need to declare it from a script. Typically, you would make it a public variable so you can set the fields from the inspector.
    I'm wired to the world... that's how I... know... everything...


  5. Posts
    111
    Quote Originally Posted by andeeee
    There isn't a GUIStyle asset type, so you do indeed need to declare it from a script.
    Thanks, the Manual isn't at all clear on that.

    Quote Originally Posted by andeeee
    Typically, you would make it a public variable so you can set the fields from the inspector.
    I understand the concept, but it does warp my mind a bit, using the Editor to change internally-created variables... Definitely blurring the line between programming and point-and-click...

    John C>
    "For all your days, prepare, and meet them ever alike;
    When you are the anvil, bear - when the hammer, strike."


  6. Location
    Cracow, Poland
    Posts
    8
    There isn't GUIStyle asset but there's GUISkin, so you can also add custom style to your custom skin (Custom Styles property in inspector). Then, you can use one style in many objects.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •