Difference between revisions of "LlSetFaceText"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {{LSL_Function |func=llSetFaceText |sort=SetFaceText |func_id|mode=request|func_sleep=0.0|func_energy=10.0 |p1_type=integer|p1_name=face|p1_desc=the face number of the prim |p2_type=string...)
 
m (Replaced <lsl> with <syntaxhighlight>)
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:
|p2_type=string|p2_name=text|p2_desc=text to display
|p2_type=string|p2_name=text|p2_desc=text to display
|p3_type=integer|p3_name=chars_per_line|p3_desc=number of characters until wrapping lines
|p3_type=integer|p3_name=chars_per_line|p3_desc=number of characters until wrapping lines
|p4_type=vector|p4_name=color|p4_desc=vector showing RGB values
|p4_type=vector|p4_name=color|p4_desc=RBG color at which text will be displayed
|p5_type=integer|p5_name=font|p5_desc=the font used
|p5_type=integer|p5_name=font|p5_desc=the font used
|func_desc=Will display '''text''' on '''face''' as a regular texture would, using the assigned '''font''', and wrapping lines at the end of '''chars_per_line'''.
|func_desc=Will display '''text''' on '''face''' in the specified '''color''' as a regular texture would, using the assigned '''font''', and wrapping lines at the end of '''chars_per_line'''.
|return_text
|return_text
|spec=
|spec=
Line 15: Line 15:
*Text will stretch across the face of the prim as a texture would, while following the '''chars_per_line''' rule only in changing the textual structure.
*Text will stretch across the face of the prim as a texture would, while following the '''chars_per_line''' rule only in changing the textual structure.
*To remove face text from '''face''', use the following:
*To remove face text from '''face''', use the following:
<lsl>llSetFaceText(face, "", 0, <1.0, 1.0, 1.0>, 0);</lsl>
<syntaxhighlight lang="lsl2">llSetFaceText(face, "", 0, <1.0, 1.0, 1.0>, 0);</syntaxhighlight>
*The '''font''' type will be based on any font built-in to the release client and available as LSL constants, such as:
*The '''font''' type will be based on any font built-in to the release client and available as LSL constants, such as:
**FACE_FONT_TIMES_NEW_ROMAN
**FACE_FONT_TIMES_NEW_ROMAN
Line 23: Line 23:
|examples=
|examples=
Example of using the function on a prim saying "Hello World":
Example of using the function on a prim saying "Hello World":
<lsl>
<syntaxhighlight lang="lsl2">
default
default
{
{
     state_entry()
     state_entry()
     {
     {
         llSetFaceText(0, "Hello World!", -1, <1.0, 1.0, 1.0>, -1);
         llSetFaceText(0, "Hello World!", -1, <1.0, 1.0, 1.0>, 1);
     }
     }
}</lsl>
}</syntaxhighlight>
|cat1
|cat1
|cat2
|cat2

Latest revision as of 19:03, 10 October 2023

Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: llSetFaceText( integer face, string text, integer chars_per_line, vector color, integer font );
0.0 Forced Delay
10.0 Energy

Will display text on face in the specified color as a regular texture would, using the assigned font, and wrapping lines at the end of chars_per_line.

• integer face the face number of the prim
• string text text to display
• integer chars_per_line number of characters until wrapping lines
• vector color RBG color at which text will be displayed
• integer font the font used

Caveats

  • Text is limited to 1024 bytes, if the string is longer it will be truncated to 1024 bytes.
  • Text will stretch across the face of the prim as a texture would, while following the chars_per_line rule only in changing the textual structure.
  • To remove face text from face, use the following:
llSetFaceText(face, "", 0, <1.0, 1.0, 1.0>, 0);
  • The font type will be based on any font built-in to the release client and available as LSL constants, such as:
    • FACE_FONT_TIMES_NEW_ROMAN
    • FACE_FONT_SANS_SERIF
    • etc
  • Use -1 for chars_per_line to disable word wrapping

Examples

Example of using the function on a prim saying "Hello World":

default
{
    state_entry()
    {
        llSetFaceText(0, "Hello World!", -1, <1.0, 1.0, 1.0>, 1);
    }
}

Deep Notes

Signature

//function void llSetFaceText( integer face, string text, integer chars_per_line, vector color, integer font );