Jump to content

Color Vector of Text


Jaguar Solo
 Share

You are about to reply to a thread that has been inactive for 2497 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Using the following script >

// Textbox2Hovertext by Ackley Bing & Omei Qunhua
// A simple script to allow object owners to change the "hovertext"
// on their prims using a text entry box (llTextBox).

integer listenhandle;
vector COLOR_YELLOW = <1.0, 1.0, 0.0>;
float OPAQUE = 1.0;


default
{
touch_start(integer num)
{
key Writer = llDetectedKey(0);
if(Writer!=llGetOwner()) return; // remove this line to allow anyone to change the hover text
llListenRemove(listenhandle);
llSetTimerEvent(60.0); // Time to input text until script closes listener in case target doesnt enter anything into textbox
listenhandle=llListen(-12345, "", Writer, "");
llTextBox( Writer, "Set Hovertext", -12345);
}
listen(integer channel, string name, key id, string message)

{

llSetText(message, <1, 1, 0>, 1);
llListenRemove(listenhandle);
llSetTimerEvent(0.0);
}
timer()
{
llListenRemove(listenhandle);
llSetTimerEvent(0.0);
}
}

Trying to change the color vector of the floating text to YELLOW (or whatever I want) but changing vector in llSetText(message, <1, 1, 0>, 1);

Does not change the color

Placed>

vector COLOR_YELLOW = <1.0, 1.0, 0.0>;
float OPAQUE = 1.0;

as a Global and the Text is still white.

Where am I going wrong?

Link to comment
Share on other sites

I have no idea. Except for the fact that those two global variables, COLOR_YELLOW and OPAQUE, are not used anywhere in the script and that it is formatted in a sloppy way, it runs just fine.  Here's a cleaned-up version:

 

integer listenhandle;default{    touch_start(integer num)    {        key Writer = llDetectedKey(0);        if (Writer == llGetOwner())        {            llListenRemove(listenhandle);            llSetTimerEvent(60.0);            listenhandle=llListen(-12345, "", "", "");            llTextBox( Writer, "Set Hovertext", -12345);        }    }    listen(integer channel, string name, key id, string message)    {        llSetText(message, <1.0, 1.0, 0.0>, 1.0);        llListenRemove(listenhandle);        llSetTimerEvent(0.0);    }    timer()    {        llListenRemove(listenhandle);        llSetTimerEvent(0.0);    }}

and a quick photo of the result:

https://gyazo.com/f0afe614a4ba9294974cbc304850d920

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2497 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...