LlSetClickAction

De DigiWiki.

This is a great way to create a user interface that evolves with the process the script is taking the user through.

key sitter;
list up_up_and_away;
 
CoughsAndLolz()
{
    integer count = 0;
    vector XYZ = llGetPos();
    float X = XYZ.x;
    float Y = XYZ.y;
    do
        up_up_and_away = up_up_and_away + [PRIM_POSITION, <X,Y,4000.0>];
    while((++count) < 400);
}
 
default
{
    state_entry()
    {
        llSetClickAction(CLICK_ACTION_SIT); // Set in state entry to be sit on click.
        llSitTarget(<0.0,0.0,0.01>, ZERO_ROTATION);
    }
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            sitter = llAvatarOnSitTarget();
            if(sitter)
            { // Someone is upon us.
                CoughsAndLolz();
                llSetClickAction(CLICK_ACTION_TOUCH);// And so we change the click action to allow the touch_start.
                llSay(0, "Click me for a thrill");
            }
        }
    }
    touch_start(integer detected)
    {
        if(sitter)
        {
            llSetLinkPrimitiveParams(LINK_SET, up_up_and_away);
            llUnSit(sitter);
            llDie();
        }        
    }           
}

Constants

Flag Description Cursor
CLICK_ACTION_NONE 0 Performs the default action: when the prim is touched, touch events are triggered. to do ...
CLICK_ACTION_TOUCH 0 When the prim is touched, touch events are triggered. to do ...
CLICK_ACTION_SIT 1 When the prim is touched, the avatar sits upon it. to do ...
CLICK_ACTION_BUY 2 When the prim is touched, the buy dialog is opened. to do ...
CLICK_ACTION_PAY 3 When the prim is touched, the pay dialog is opened. to do ...
CLICK_ACTION_OPEN 4 When the prim is touched, the object inventory dialog is opened. to do ...
CLICK_ACTION_PLAY 5 Play or pause parcel media on touch. to do ...
CLICK_ACTION_OPEN_MEDIA 6 Play parcel media on touch, no pause. to do ...
CLICK_ACTION_ZOOM 7 Zoom (Viewer 2). to do ...
Outils personnels
  • Cette page a été consultée 1 486 fois.
donate
Google Ads