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