GUIStyle impementation

My custom style is called “Menu”

if (from Docs)
static function BeginArea (screenRect : Rect, text : String) : void
equates to
Then wat does (from the docs)
static function BeginArea (screenRect : Rect, style : GUIStyle) : void
look like in code because its not


Well there's a little problem. Unity have implemented this implicit operator to automatically convert a string into a GUIStyle. However the compiler have to statically bind the correct function and since there is an overloaded form that accepts a string at this parameter position that's the one that is used.

You have two options here:

  • Use to get the GUIStyle yourself
  • Use the another overloaded function that takes a Rect, a string and a GUIStyle

Here's the code:

// first solution

// second solution