LSL Wiki Mirror 10-5-2006: llSetText

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
llSetText(string text, vector color, float alpha)

Sets the contents of text as floating text over the prim using the specified color and transparency (alpha).

"\n" can be used to start a new line. Empty lines must have at least one character (use a space: " \n"). text has a length limit of 255 characters.

To remove text from a prim, leave text empty: ""
llSetText("",<0,0,0>,0)

Note: Floating text is a property of the prim, not the script. As such, it will remain until removed explicitly. Simply deleting the script that set the text will not remove the text.

The text will always be positioned to float straight up (parallel to the world's Z-axis) from the prim's center at a distance of half the prim's Z scale plus some fixed offset.

To actually display text on a prim (not hover text), see XyText.

As of Version 1.8.4, alpha is no longer ignored.

Examples:
// Set text to say "Hello." in bright red
llSetText("Hello.", <1,0,0>, 1.0);

// Remove text
llSetText("", <0,0,0>, 1.0);

// Set text to say "Hello" and "How are you?" on two different lines
llSetText("Hello.\nHow are you?", <1,0,0>, 1.0);

// Use a function to display the current region
llSetText("You're currently in " + llGetRegionName(), <0,1,0>, 1);


Functions | Text
There are 18 comments on this page. [Display comments/form]