Change font size
It is currently Thu Nov 22, 2018 5:24 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Change Color and Size on Touch
PostPosted: Sun Feb 03, 2008 3:48 am 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
{L_CODE}:
default
{
    state_entry()
    {
        llSay( 0, "Hello, Avatar! Touch to change color and size.");
        counter = 0;
    }

    touch_start(integer total_number)
    {   // do these instructions when the object is touched.
        counter = counter + 1;

        // choose three random RGB color components between 0. and 1.0.
        float redness = llFrand( 1.0 );
        float greenness = llFrand( 1.0 );
        float blueness = llFrand( 1.0 );

        // combine color components into a vector and use that vector
        // to set object color.
        vector prim_color = < redness, greenness, blueness >;
        llSetColor( prim_color, ALL_SIDES );   // set object color to new color.

        // choose a random number between 0. and 10. for use as a scale factor.
        float new_scale = llFrand(10.0) + 1.0;
        llSetScale(< new_scale, new_scale, new_scale > ); // set object scale.       
        llSay( 0, "Touched by angel number " + (string)counter);
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net