GUI Style

The native GUI uses a CSS (Cascading Style Sheet) approach that is familiar to those in the Web development field. A GUI Style holds a series of GUI Controls for all of the different elements you might use in your interface. Anytime you create a button, label, text field, or other element, it uses the GUI Style you have defined. This is handy if you want all of your GUI elements to follow the same rules, allowing you to control them from a single script.

Note

Unity comes with its own internal GUI Style. You can create your own, but if you choose not to, when you call the OnGUI() function, the internal Unity one will be used.

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.