Difference between revisions of "LlSetText"

From Second Life Wiki
Jump to navigation Jump to search
Line 5: Line 5:
|func=llSetText
|func=llSetText
|sort=SetText
|sort=SetText
|p1_type=text
|p1_type=String
|p1_name=String
|p1_name=text
|p1d = text to display between the quotes
|p1d = text to display between the quotes
|p2_type=color
|p2_type=Vector
|p2_name=Vector
|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> = black, <1,1,1> = white.
|p3_type=alpha
|p3_type=Float
|p3_name=Float
|p3_name=alpha
|p3d = visibility, a number between 0 and 1.  0 is fully transparent (invisible), 1.0 is fully visible (opaque).
|p3d = visibility, a number between 0 and 1.  0 is fully transparent (invisible), 1.0 is fully visible (opaque).
llSetText(String text, Vector color, Float alpha);
llSetText(String text, Vector color, Float alpha);
Line 20: Line 20:
|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=None known.
|caveats=None known.
|examples=<lsl>
|examples=


llSetText("I am on", <1,1,1>,1.0);
llSetText("I am on", <1,1,1>,1.0);
Line 33: Line 33:
|also_functions
|also_functions
|also
|also
|notes=
|notes=Most people put this in the default code, such as:


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


|te = Examples:
    }
 
    touch_start(integer total_number)
    {
    llSay(0, "Touched.");
    }
}




}}
}}

Revision as of 09:58, 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.None known.

Examples

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

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

llSetText("I am off", <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).

Notes

Most people put this in the default code, such as:

default {

    state_entry()
    {
    llSay(0, "Hello, Avatar!");
    llSetText("Prize Box", <0,1,0>, 1.0);
    }
    touch_start(integer total_number)
    {
    llSay(0, "Touched.");
    }

}

Deep Notes

Signature

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