Results 1 to 3 of 3

Thread: Interactive Slider

  1. #1
    Super Member Kevbarnes's Avatar
    Join Date
    Nov 2006
    Location
    Gloucestershire UK
    Posts
    495

    Interactive Slider

    Hi I trying to script an interactive slider.
    '
    see Attached rar file with scripts 'version01' and 'version02'

    I've got so far with 'v01' which establishes the slider
    but I don't know how to implement what I think is a 'Call-Back'?.

    I've tride using 'reqopen' and adding what I think is a refresh action on the slider

    but nothing seems to work - is this possible?
    Attached Files Attached Files
    "one rig to rule them all"
    PC Spec: Intel i7 X980 3.33GHz | 24Gb | ATI FirePro V5800 | W7
    https://vimeo.com/kevbarnes/showreel
    https://littlstar.com/kevbarnes
    https://www.talenthouse.com/kevbarnes

  2. #2
    Code Muppet evenflcw's Avatar
    Join Date
    Feb 2003
    Location
    Stockholm, Sweden
    Posts
    2,642
    You should use the callback to set your internal data variable. Also don't forget to set the initial value of the control to the same as the internal one so they don't start out of synch.

    Code:
    options
    {
        if(reqisopen()) reqend(); //closes previous panel if any open
        reqbegin("SliderControl");
    
        c0 = ctlchoice("Control Axis",ControlPos,@"X","Y","Z"@);
        c2 = ctlslider("Slider",1,1,100);
    	
        setvalue(c2, SlideAmount); //starting value when panel opens
    
        ctlrefresh(c2,"refresh1");
    
        reqopen();
    }
    
    
    refresh1: value
    {
        SlideAmount = value; //or = getvalue(c2);
    }
    Last edited by evenflcw; 03-18-2012 at 01:07 PM.

  3. #3
    Super Member Kevbarnes's Avatar
    Join Date
    Nov 2006
    Location
    Gloucestershire UK
    Posts
    495
    thanks evenflcw

    that now works great.

    I'll have to do the same action on the 'Axis choice' variable as its only getting the initial value.

    Many thanks

    Kev
    "one rig to rule them all"
    PC Spec: Intel i7 X980 3.33GHz | 24Gb | ATI FirePro V5800 | W7
    https://vimeo.com/kevbarnes/showreel
    https://littlstar.com/kevbarnes
    https://www.talenthouse.com/kevbarnes

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •