Difference between revisions of "LlSetTouchText"

From Second Life Wiki
Jump to navigation Jump to search
m
(Added to caveats.)
Line 10: Line 10:
|return_text
|return_text
|spec
|spec
|caveats=*The '''text''' is limited to 9 bytes.
|caveats=*'''Text''' will only be displayed if set by a script calling this function in the root. If '''text''' is set by a script in a child the '''text''' will only be displayed after unlinking it or relinking it as the root. If either a child or the root is selected as an individual prim and right clicked, the '''text''' displayed will be the default even if a script in the root has set '''text'''. More simply - The '''text''' property displayed on right click will always be that of the root unless, right clicking a prim under individual edit when it will always be the LL default.
**A tab (\t) counts as 4 bytes (four spaces).
*Note that like particles, and the other set text functions, all '''text''' set via llSetTouchText becomes a property of a  prim, not a script. For that reason, the '''text''' will remain if the script that set it is deactivated or even removed.
**The newline character (\n) will count as 1 byte, but will have no effect on how the text is rendered (so don't use it).
*You have no control over the face, size or colour of the displayed '''text'''.
**The byte count for each Unicode character is equal to the number of bytes needed to represent it in UTF-8.
*The '''text''' is limited to 9 characters.
|examples=
|examples=
<lsl>default
<lsl>default

Revision as of 16:04, 19 March 2010

Summary

Function: llSetTouchText( string text );
0.0 Forced Delay
10.0 Energy

Displays text rather than the default "Touch" in the pie menu

• string text

This is very similar to LlSetSitText.
To restore the default value, use an empty string for text.
To make it appear as if there is no text, use some combination of whitespace characters for text.

Caveats

  • Text will only be displayed if set by a script calling this function in the root. If text is set by a script in a child the text will only be displayed after unlinking it or relinking it as the root. If either a child or the root is selected as an individual prim and right clicked, the text displayed will be the default even if a script in the root has set text. More simply - The text property displayed on right click will always be that of the root unless, right clicking a prim under individual edit when it will always be the LL default.
  • Note that like particles, and the other set text functions, all text set via llSetTouchText becomes a property of a prim, not a script. For that reason, the text will remain if the script that set it is deactivated or even removed.
  • You have no control over the face, size or colour of the displayed text.
  • The text is limited to 9 characters.

Examples

<lsl>default {

   state_entry()
   {
       llSetTouchText("Touch me!");
   }
   touch_start(integer detected)
   {
       llSay(0, "you touched me!");
   }
}</lsl>

See Also

Functions

•  llSetSitText

Articles

•  Touch

Deep Notes

Signature

function void llSetTouchText( string text );