Difference between revisions of "PRIM TEXT"

From Second Life Wiki
Jump to navigation Jump to search
m
m (<lsl> tag to <source>)
 
(16 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<onlyinclude>{{#if:
<onlyinclude>{{#if:


{{LSL Function/limits}}
{{LSL Function/color|color}}
{{LSL Function/color|color}}
{{LSL Function/alpha|alpha}}
{{LSL Function/alpha|alpha}}
Line 8: Line 9:
{{#vardefine:p_text_hover|{{#switch:{{{1|}}}|get={{#var:p_text_get_hover}}|set={{#var:p_text_set_hover}}|floating text}}}}
{{#vardefine:p_text_hover|{{#switch:{{{1|}}}|get={{#var:p_text_get_hover}}|set={{#var:p_text_set_hover}}|floating text}}}}


{{#vardefine:p_text_set_desc|[[llSetText|floating text]] to display}}
{{#vardefine:p_text_set_desc|[[:Category:LSL Floating Text|floating text]] to display}}
{{#vardefine:p_text_get_desc|[[llSetText|floating text]] displayed}}
{{#vardefine:p_text_get_desc|[[:Category:LSL Floating Text|floating text]] displayed}}
{{#vardefine:p_text_desc|{{#switch:{{{1|}}}|get={{#var:p_text_get_desc}}|set={{#var:p_text_set_desc}}|[[llSetText|floating text]]}}}}
{{#vardefine:p_text_desc|{{#switch:{{{1|}}}|get={{#var:p_text_get_desc}}|set={{#var:p_text_set_desc}}|[[:Category:LSL Floating Text|floating text]]}}}}


{{#vardefine:text_const|{{LSL Const|PRIM_TEXT|integer|26|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the object's floating text}}}}
{{#vardefine:text_const|{{LSL Const|PRIM_TEXT|integer|26|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the object's floating text}}}}


{{#vardefine:caveats|{{#var:caveats}}
{{#vardefine:caveats|{{#var:caveats}}
* Do not rely on {{#var:text_const}} as a storage medium. Floating text has been altered in past server updates, and even "invisible" floating text can be read by anybody.}}
* Do not rely on [[:Category:LSL Floating Text|Floating Text]] as a storage medium; it is neither secure nor finalized.
** Floating text has been altered in past server updates, breaking existing content; future changes may occur.
** Even "invisible"{{Footnote|1=Floating text with an {{LSLP|alpha}} set to 0.0 is rendered "invisible"|2=Floating text with an alpha set to 0.0 is rendered {{String|invisible}}}} floating text is transmitted to the client.
*** It can be viewed by anyone with a client that is capable of rendering text that is supposed to be invisible.
*** The network packets that contain the text can be sniffed and the text read.}}


}}</onlyinclude>{{#if:
}}</onlyinclude>{{#if:


}}{{LSL Constant
}}{{LSL Constant
|inject-2={{LSL PrimitiveParam Categorize|Prim}}
|name=PRIM_TEXT
|name=PRIM_TEXT
|type=integer
|type=integer
|value=26
|value=26
|desc={{KBcaution|This function is not yet released and will be available with Server 1.38.}}
|desc=Used to get or set the object's [[:Category:LSL Floating Text|floating text]].
Used to get or set the object's [[llSetText|floating text]].
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ {{#var:text_const}},&#32;|i_end=&nbsp;]);|
|pa={{LSL Constant/List|i_front=[[llSetPrimitiveParams]]([ {{#var:text_const}},&#32;|i_end=&nbsp;]
|text=Syntax for: [[llSetPrimitiveParams]], [[llSetLinkPrimitiveParams]] & [[llSetLinkPrimitiveParamsFast]]
|text=Syntax for: [[llSetPrimitiveParams]], [[llSetLinkPrimitiveParams]] & [[llSetLinkPrimitiveParamsFast]]
|i1_type=string|i1_name=text_set|i1_disp=text
|i1_type=string|i1_name=text_set|i1_disp=text
Line 40: Line 45:
|toc=llGetPrimitiveParams
|toc=llGetPrimitiveParams
}}
}}
|examples=
|examples=<source lang="lsl2">default
{
    state_entry()
    {
        // a string to display
        string displayMessage = llGetDisplayName( llGetOwner() ) + ", test number ";
       
        // just so could test changing the displayMessage
        integer loopControl;
        for( loopControl = 1; loopControl < 3; ++loopControl )
        {
            // on first iteration set the text
            if( loopControl == 1 )
            {
                llSetPrimitiveParams([PRIM_TEXT, displayMessage + (string)loopControl + ".", <1, 0, 0>, 1.0]);
            }
           
            // on second iteration get the text and say it.
            else if( loopControl == 2 )
            {
                llSay(0, llDumpList2String(llGetPrimitiveParams([PRIM_TEXT]), " "));
            }
        }
    }
}</source>
|constants=
|constants=
|functions=
|functions=
Line 51: Line 80:
|events
|events
|location
|location
|cat1=Object
|cat1
|cat2=Floating Text
|cat2=Floating Text
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 15:58, 23 January 2015

Description

Constant: integer PRIM_TEXT = 26;

The integer constant PRIM_TEXT has the value 26

Used to get or set the object's floating text.

llSetPrimitiveParams

llSetPrimitiveParams([ PRIM_TEXT, string text, vector color, float alpha ]);
• string text floating text to display
• vector color color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white)
• float alpha from 0.0 (clear) to 1.0 (solid) (0.0 <= alpha <= 1.0)

Syntax for: llSetPrimitiveParams, llSetLinkPrimitiveParams & llSetLinkPrimitiveParamsFast

llGetPrimitiveParams

llGetPrimitiveParams([ PRIM_TEXT ]);

Returns the list [ string text, vector color, float alpha ]

• string text floating text displayed
• vector color color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white)
• float alpha from 0.0 (clear) to 1.0 (solid) (0.0 <= alpha <= 1.0)

Syntax for: llGetPrimitiveParams, llGetLinkPrimitiveParams

Caveats

  • Do not rely on Floating Text as a storage medium; it is neither secure nor finalized.
    • Floating text has been altered in past server updates, breaking existing content; future changes may occur.
    • Even "invisible"[1] floating text is transmitted to the client.
      • It can be viewed by anyone with a client that is capable of rendering text that is supposed to be invisible.
      • The network packets that contain the text can be sniffed and the text read.


Related Articles

Functions

•  llSetPrimitiveParams
•  llSetLinkPrimitiveParams
•  llSetLinkPrimitiveParamsFast
•  llGetPrimitiveParams
•  llGetLinkPrimitiveParams
•  llSetText

Articles

•  Limits SL limits and constrictions
•  Color in LSL
•  Translucent Color

Examples

default
{
    state_entry()
    {
        // a string to display
        string displayMessage = llGetDisplayName( llGetOwner() ) + ", test number "; 
        
        // just so could test changing the displayMessage
        integer loopControl;
        for( loopControl = 1; loopControl < 3; ++loopControl )
        {
            // on first iteration set the text 
            if( loopControl == 1 )
            {
                llSetPrimitiveParams([PRIM_TEXT, displayMessage + (string)loopControl + ".", <1, 0, 0>, 1.0]);
            }
            
            // on second iteration get the text and say it. 
            else if( loopControl == 2 )
            {
                llSay(0, llDumpList2String(llGetPrimitiveParams([PRIM_TEXT]), " "));
            }
        }
    }
}

Deep Notes

Search JIRA for related Issues

Footnotes

  1. ^ Floating text with an alpha set to 0.0 is rendered "invisible"

Signature

integer PRIM_TEXT = 26;