# PRIM_TEXT

*LSL constant*

```lsl
integer PRIM_TEXT = 26;
```

Prim parameter [PRIM_TEXT, string text, vector color, float alpha] to get or set the object's floating/hover text (equivalent to llSetText).

Constant groups: [PrimParam](/constants/groups/PrimParam/), [PrimParamGet](/constants/groups/PrimParamGet/)

Used to get or set the object's [floating text](https://wiki.secondlife.com/wiki/Category:LSL_Floating_Text).

## Caveats

- Do not rely on [Floating Text](https://wiki.secondlife.com/wiki/Category:LSL_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"[^wiki-374698] 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.

[^wiki-374698]: Floating text with an **alpha** set to 0.0 is rendered "invisible"

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={1-12}
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]), " "));
            }
        }
    }
}
```

</details>

## See also

### Functions

- [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/)
- [llGetPrimitiveParams](/functions/llGetPrimitiveParams/)
- [llGetLinkPrimitiveParams](/functions/llGetLinkPrimitiveParams/)
- [llSetText](/functions/llSetText/)

---

*Source: [PRIM TEXT](https://wiki.secondlife.com/wiki/PRIM_TEXT) on the Second Life Wiki. Content from the Second Life Wiki articles PRIM TEXT (revision 1194695, 2015-01-23) and Template:LSL PrimitiveParam Categorize (revision 1180644, 2013-08-09), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/constants/PRIM_TEXT/
