Difference between revisions of "Color-to-Vector Tool"

From Second Life Wiki
Jump to navigation Jump to search
m (lsl code tagging)
m (<lsl> tag to <source>)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
This script is useful as a WYSIWYG color reporter.  Each time the prim's color changes, the color vector is chatted to the owner.  Note, it reports the color of face 0(zero) by default.
This script is useful as a WYSIWYG color reporter.  Each time the prim's color changes, the color vector is chatted to the owner.  Note, it reports the color of face 0(zero) by default.


<lsl>
<source lang="lsl2">
integer FACE = 0;
integer FACE = 0;


Line 12: Line 12:
     }
     }
}
}
</lsl>
</source>
 
This script shows it hovering over the prim as well for less chat spam and longer display value.
<source lang="lsl2">
default {
    changed(integer change) {
        if (change & CHANGED_COLOR) llSetText("Color Vector = " + (string)llGetColor(0),<1.0,1.0,1.0>,1.0);
    }
}
</source>
[[Category:LSL Examples]]
[[Category:LSL Examples]]

Latest revision as of 14:19, 24 January 2015

Say the Prim's Color Vector

This script is useful as a WYSIWYG color reporter. Each time the prim's color changes, the color vector is chatted to the owner. Note, it reports the color of face 0(zero) by default.

integer FACE = 0;

default {
    changed(integer change) {
        if (change & CHANGED_COLOR) llOwnerSay("Color Vector = " + (string)llGetColor(FACE));
    }
}

This script shows it hovering over the prim as well for less chat spam and longer display value.

default {
    changed(integer change) {
        if (change & CHANGED_COLOR) llSetText("Color Vector = " + (string)llGetColor(0),<1.0,1.0,1.0>,1.0);
    }
}