Don't click here unless you want to be banned.

LSL Wiki : llSetText

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

- string text
The Text displayed over the object. (Length Limit: 254 bytes (extended ASCII such as accented characters count as two bytes))

- vector color
The colorvector. Picks the color with which the text is displayed.
Format: <0, 0, 0>
To convert from RGB to the vector value, divide the RGB value with 255.
Example: 255, 0, 0 (Red) = 255/255, 0/255, 0/255 = <1, 0, 0>

- float alpha
Decides the transparency of the text from 0.1 (high transparency) to 1.0 (no transparency).

Detailed Information:
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 254 characters. The Second Life viewer will wrap the text automatically so it doesn't exceed 1000 pixels width (as opposed to wrapping after a certain number of characters - this is because the default font is proportional so different characters have different width).

To remove text from a prim, leave text empty: ""

The following code fixes the "\n" not being converted in literal cases. Chat input, variables, etc... -SiRiSAsturias
msg = llDumpList2String(llParseString2List(msg, ["\\n"], []), "\n");

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.
The float text uses the prims Z axis regardless of it?s rotation. This means that if you rotate a prim 90 degrees and flatten it, the text will float just above the center.

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

As of Version 1.8.4, alpha is no longer ignored.

// 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);

Q: If I llSetText in a linked Object, 70% of time its ok but there are random cases when the Text does not show to an avator even though others at the time can see ok! Any Suggestions as to why? I understand text is a property of the Prim and not the Script.
A: From what others have seen from similar situations, this is merely the asset server being buggy, sometimes people can see whole prims others cant

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

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