Click here for a free demo!
This button is designed to be a building component for user interfaces. It allows someone to click on it and change its state. It can be linked to other objects and sends and receives link messages to change its state. Finally the owner can change the size of the button, change the sound of the click and select the color to be displayed. There are 14 colors to select from.
Usage:
Click the button test box you received. You will get a menu with the following options:
Rez button - rezzes a button above the box that can be used in building.
Give button - gives the owner a button in their inventory under Objects.
Example - gives the owner an example script similiar to the one running in the box. Note this script is set to not be running so if you wish to use it, please set it to running in your own creation.
Help - provides this notecard.
Modification:
The size of the button can be changed by resizing it but I do not recommend changing the shape. If the shape is changed the texture may not map properly.
The color of the button may be set by editing the description of the object. Valid colors are: blue, green,orange, brown, purple, red, sky blue, dark red, yellow, forest green, candy blue, candy red, white and aqua.
You can change the default sound by replacing the sound file in the button named "click".
Scripting:
The button is designed to interact with a script in the root prim. The button
will send a linked message to the root prim when it is pressed. The root prim may also send link messages to each button in the object.
When a button is pressed it sends the following link message to the root prim:
llMessageLinked(LINK_ROOT, on,UserName,UserKey);
The current on status is TRUE or FALSE. The link message also contains the name and id of the person who clicked on it.
The root prim can send several different messages to the button. These are in the form:
llMessageLinked(link_num, 0,cmd arg);
Where:
link_num is the link number of the button.
cmd is the command to the button.
and arg is the argument passed to the button.
There are 4 commands that can be sent to the button:
color - set the color to the string value of the argument
on - turns the button on
off - turns the button off
user - sets the user who is allowed to use the button. The user's key is passed as an argument. To allow anyone to use the button set the argument to a NULL_KEY.
Please see the example script for usage examples.