Difference between revisions of "LlSetTouchText"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Replaced <source> with <syntaxhighlight>, added reference to UTF-8 text, added Haiku done with Poem Generator, fixed duplicate 'sort' parameter)
 
(12 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{LSL_Function
{{Issues/SVC-4870}}{{LSL_Function
|func=llSetTouchText
|func=llSetTouchText
|sort=SetTouchText
|sort=SetTouchText
|func_id=241|func_sleep=0.0|func_energy=10.0
|func_id=241|func_sleep=0.0|func_energy=10.0
|p1_type=string|p1_name=text
|p1_type=string|p1_name=text
|func_footnote=
|func_footnote=This is very similar to [[LlSetSitText]].<br/>
|func_desc=Displays '''text''' rather than the default "Touch" in the pie menu
To restore the default value, use an empty string for '''text'''.<br/>
To make it appear as if there is no text, use some combination of whitespace characters for '''text'''.
|func_desc=Displays '''text''' rather than the default "Touch" in the right-click menu
|return_text
|return_text
|spec=
|spec
The '''text''' is limited to 9 characters. A tab (\t) counts as 4 characters. The newline character (\n) will count as 1 character, though it is a bit of a waste, as it will have no effect on how the text is displayed. Aside from counting toward the limit, it will otherwise be ignored.
|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.
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'''.
 
*'''text''' is limited to 9 characters{{Footnote|This function also accepts the UTF-8 character set, in which case the number of displayed characters ''may'' be even less than 9 ASCII characters}}.
You have no control over the face face, size or colour of the displayed text.
|examples=
 
<syntaxhighlight lang="lsl2">default
 
{
==Usage==
     state_entry()
<lsl>default{
    {
     state_entry(){
         llSetTouchText("Touch me!");
         llSetTouchText("Touch me!");
     }
     }
     touch_start(integer detected){
     touch_start(integer detected)
    {
         llSay(0, "you touched me!");
         llSay(0, "you touched me!");
     }
     }
}</lsl>
}</syntaxhighlight>
 
 
== Removing Touch Text ==
There is no way to stop a pie menu from having a "Touch" space reserved on it.
 
To remove custom text that you have placed there, set the text as space: "&nbsp;".
 
<lsl>default{
    state_entry(){
        llSetTouchText(" ");
    }
}</lsl>
 
Upon your having done so, the text that appears will revert to "Touch."
 
 
 
|caveats
|constants
|constants
|helpers
|helpers
|also_functions=*{{LSLG|llSetSitText}}
|also_functions={{LSL DefineRow||[[llSetSitText]]}}
|also_events
|also_events
|also_tests
|also_tests
|also_articles=*{{LSLGC|Touch}}
|also_articles={{LSL DefineRow||{{LSLGC|Touch}}}}
|notes
|notes
|permission
|permission
|negative_index
|negative_index
|sort=SetTouchText
|haiku={{Haiku|Glorious morning|Curious avatar clicks|at the perfect touch}}
|cat1=Pie Menu
|cat1=Pie Menu
|cat2=Touch
|cat2=Touch
|cat3=Text
|cat3=Text
|cat4
|cat4=Prim
|cat5=Effects
}}
}}

Latest revision as of 04:51, 3 May 2022

Summary

Function: llSetTouchText( string text );

Displays text rather than the default "Touch" in the right-click 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.
  • text is limited to 9 characters[1].

Important Issues

~ All Issues ~ Search JIRA for related Bugs
   llSetSitText does not apply for child prims, only the main prims sit text gets displayed

Examples

default
{
    state_entry()
    {
        llSetTouchText("Touch me!");
    }
    touch_start(integer detected)
    {
        llSay(0, "you touched me!");
    }
}

See Also

Functions

•  llSetSitText

Articles

•  Touch

Deep Notes

All Issues

~ Search JIRA for related Issues
   llSetSitText does not apply for child prims, only the main prims sit text gets displayed

Footnotes

  1. ^ This function also accepts the UTF-8 character set, in which case the number of displayed characters may be even less than 9 ASCII characters

Signature

function void llSetTouchText( string text );

Haiku

Glorious morning
Curious avatar clicks
at the perfect touch