GUIButton.Colour

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This member variable sets/returns the colour of the button.

Syntax

  1. Colour GUIButton.Colour
  1. 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.

  1.  
  2. function onClientClickButton( button )
  3. {
  4. Message( "R: " + button.Colour.r );
  5. Message( "G: " + button.Colour.g );
  6. Message( "B: " + button.Colour.b );
  7. }
  8.  

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.

  1.  
  2. function onClientClickButton( button )
  3. {
  4. button.Colour = Colour(0, 0, 255);
  5. }
  6.  

Notes

The event onClientClickButton and script type Colour were used in this example. More information can be found on their corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox