GUIButton.Colour
From Liberty Unleashed Wiki
This member variable sets/returns the colour of the button.
Syntax
Colour GUIButton.Colour
GUIButton.Colour = Colour col
Arguments
- col - This is a Colour class object
Example 1. Returning
This code will message the player with the RGB values of a button when they click on one.
function onClientClickButton( button ) { Message( "R: " + button.Colour.r ); Message( "G: " + button.Colour.g ); Message( "B: " + button.Colour.b ); }
Notes
The event onClientClickButton and function Message were used in this example. More information can be found on their corresponding pages.
Example 2. Setting
This code will make a button absolutely blue when clicked on.
function onClientClickButton( button ) { button.Colour = Colour(0, 0, 255); }
Notes
The event onClientClickButton and script type Colour were used in this example. More information can be found on their corresponding pages.