NumRs

De DigiWiki.

NumRs is an alternative to XyText for numbers, scripted by NornAlbion. Using only one texture, it obviously loads faster, however it is a a maximum of 3 numbers per prim. It could be made to be 6, but there was no need when it was scripted.

It uses the XyText prim setup script. To get it to display numbers, llMessageLinked it with a string consisting of three or more numbers. Any characters after the first three are truncated. The number and key of the linked message are not important.

NumRs script:

list horizontals = [0.410,-0.490,-0.390,-0.290,-0.190,-0.090,0.010,0.110,0.210,0.310];
vector repeats = <0.100,0.5,0>;
vector normoffset = <0.310,0.250,0>;
key texture = "42e6610b-3ad8-c81a-9701-ba7186a2ea7e";
// 4 = left
// 0 = middle
// 2 = right
default
{
    state_entry()
    {
        llSetPrimitiveParams([
        PRIM_TEXTURE,4,texture,repeats,normoffset,PI_BY_TWO,
        PRIM_TEXTURE,0,texture,repeats,normoffset,0,
        PRIM_TEXTURE,2,texture,repeats,normoffset,-PI_BY_TWO
        ]);
    }
    link_message(integer sender, integer num, string mesg, key id) {
            integer num1; integer num2; integer num3;
            integer thenum = (integer)mesg;
            if(thenum < 10) {
                num2 = 0;
                num3 = (integer)llGetSubString(mesg,0,0);
                num1 = 0;
            } else if(thenum < 100) {
                num2 = (integer)llGetSubString(mesg,0,0);
                num3 = (integer)llGetSubString(mesg,1,1);
                num1 = 0;
            } else  {
                num2 = (integer)llGetSubString(mesg,1,1);
                num3 = (integer)llGetSubString(mesg,2,2);
                num1 = (integer)llGetSubString(mesg,0,0);
            }
            llSetPrimitiveParams([
            PRIM_TEXTURE,4,texture,repeats,<llList2Float(horizontals,num1),normoffset.y,0>,PI_BY_TWO,
            PRIM_TEXTURE,0,texture,repeats,<llList2Float(horizontals,num2),normoffset.y,0>,0,
            PRIM_TEXTURE,2,texture,repeats,<llList2Float(horizontals,num3),normoffset.y,0>,-PI_BY_TWO
            ]);
    }
}
Outils personnels
  • Cette page a été consultée 443 fois.
donate
Google Ads