Difference between revisions of "LlSetText"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 11: Line 11:
|p2_type=Vector
|p2_type=Vector
|p2_name=color
|p2_name=color
|p2d = color in RGB enclosed between <> signs, as in <0,0,0> = black, <1,1,1> = white.
|p2d = color in RGB enclosed between <> signs, as in <0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white.
|p3_type=Float
|p3_type=Float
|p3_name=alpha
|p3_name=alpha
|p3d = visibility, a number between 0 and 1. 0 is fully transparent (invisible), 1.0 is fully visible (opaque).
|p3d = visibility, 0.0 is fully transparent and 1.0 is fully visible.
llSetText(String text, Vector color, Float alpha);
llSetText(string text, vector color, float alpha);


|func_desc=This function is used to set text to display over an object in SL.
|func_desc=This function is used to set text to display over an object in SL.
|return_text
|return_text
|spec=Displays text placed over object -- programmer specifies text, color and visibility/transparency.
|spec=Displays text placed over object -- programmer specifies text, color and visibility/transparency.
|caveats=The floating text is a property of the prim and not the script, thus the text will remain if the script is deactivated or removed.  To remove floating text, one must assign an empty string with llSetText("", <1,1,1>,1.0);
|caveats=The floating text is a property of the prim and not the script, thus the text will remain if the script is deactivated or removed.  To remove floating text, one must assign an empty string with llSetText("", <1.0, 1.0, 1.0>, 1.0);
|examples=
|examples=


llSetText("I am on", <1,1,1>,1.0);
llSetText("I am on", <1.0, 1.0, 1.0>, 1.0);


<1,1,1> represents the values for red, green, and blue. <1,1,1>, means "white" and <0,0,0> means "black".  
<1.0, 1.0, 1.0> represents the values for red, green, and blue. <1.0, 1.0, 1.0>, means "white" and <0.0, 0.0, 0.0> means "black".  


llSetText("I am off", <0,0,0>,1.0);
llSetText("I am off", <0.0, 0.0, 0.0>, 1.0);


The 1.0 is the alpha setting. 1.0 means fully opaque, and 0.0 would be completely transparent (invisible).  
The 1.0 is the alpha setting. 1.0 means fully opaque, and 0.0 would be completely transparent (invisible).  
Line 38: Line 38:
     {
     {
     llSay(0, "Hello, Avatar!");
     llSay(0, "Hello, Avatar!");
     llSetText("Prize Box", <0,1,0>, 1.0);
     llSetText("Prize Box", <0.0, 1.0, 0.0>, 1.0);
     }
     }
   
   

Revision as of 14:49, 6 February 2007

Summary

Function: llSetText( String text, Vector color, Float alpha );

This function is used to set text to display over an object in SL.

• String text
• Vector color
• Float alpha

Specification

Displays text placed over object -- programmer specifies text, color and visibility/transparency.

Caveats

Expression error: Unexpected > operator.The floating text is a property of the prim and not the script, thus the text will remain if the script is deactivated or removed. To remove floating text, one must assign an empty string with llSetText("", <1.0, 1.0, 1.0>, 1.0);

Examples

llSetText("I am on", <1.0, 1.0, 1.0>, 1.0);

<1.0, 1.0, 1.0> represents the values for red, green, and blue. <1.0, 1.0, 1.0>, means "white" and <0.0, 0.0, 0.0> means "black".

llSetText("I am off", <0.0, 0.0, 0.0>, 1.0);

The 1.0 is the alpha setting. 1.0 means fully opaque, and 0.0 would be completely transparent (invisible).

Example of how llSetText could be included in default code:

default
{
    state_entry()
    {
    llSay(0, "Hello, Avatar!");
    llSetText("Prize Box", <0.0, 1.0, 0.0>, 1.0);
    }

    touch_start(integer total_number)
    {
    llSay(0, "Touched.");
    }
}

Notes

Most commonly, this is included in the default code for an object (see example above).

Deep Notes

Signature

function void llSetText( String text, Vector color, Float alpha );