Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Xylor's floating name

Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
06-12-2003 14:11
This is just a little script you can use to have your
objects display their name over themselves in a
suitable color. It tracks color changes, and
periodically updates in case you change the name of
the object.

CODE

//////////////////////////////
// Floating Name Script
//
// This script periodically updates
// the text above the object to
// display the name of the object
///////////////////////////////

integer SIDE_TO_CHECK_COLOR = 0;

UpdateText() {
vector RGB = llGetColor(SIDE_TO_CHECK_COLOR);

// Rotate the Hue 180 degrees, and
// invert the Luminance.
RGB.x = 1.0 - RGB.x;
RGB.y = 1.0 - RGB.y;
RGB.z = 1.0 - RGB.z;

llSetText(llGetObjectName(), RGB, 1.0);
}

default {
state_entry() {
UpdateText();
// Update the text every 5 seconds.
llSetTimerEvent(5.0);
}

changed(integer change) {
if (change == CHANGED_COLOR) {
UpdateText();
}
}

timer() {
UpdateText();
}
}


created by Xylor
6-12-2003
_____________________
i've got nothing. ;)
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
04-25-2005 09:00
/15/03/3068/1.html
_____________________
i've got nothing. ;)