Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GUIContent

The contents of a GUI element.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Class
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule
public class GUIContent

Remarks

This works closely in relation with GUIStyle. GUIContent defines
what
to render and GUIStyle defines
how
to render it.
Additional Resources: GUIStyle

Static Fields

Value

Description

noneShorthand for empty content.

Constructors

Constructor

Description

GUIContent()Constructor for GUIContent in all shapes and sizes.
GUIContent(System.String)Build a GUIContent object containing only text.
GUIContent(System.String,System.String)Build a GUIContent containing some
text
. When the user hovers the mouse over it, the global _tooltip is set to the
tooltip
.
GUIContent(System.String,UnityEngine.Texture)Build a GUIContent object containing both
text
and an image.
GUIContent(System.String,UnityEngine.Texture,System.String)Build a GUIContent that contains both
text
, an
image
and has a
tooltip
defined. When the user hovers the mouse over it, the global _tooltip is set to the
tooltip
.
GUIContent(UnityEngine.GUIContent)Build a GUIContent as a copy of another GUIContent.
GUIContent(UnityEngine.Texture)Build a GUIContent object containing only an image.
GUIContent(UnityEngine.Texture,System.String)Build a GUIContent containing an image. When the user hovers the mouse over it, the global _tooltip is set to the
tooltip
.

Properties

Property

Description

imageThe icon image contained.
textThe text contained.
tooltipThe tooltip of this element.