[SOLVED] Convert Blend slider in Zoom slider ?

  • Hi,

    yes, just replacing the setblend call would be a possibility,
    the "val" variable has a value in the range 0.0 to 1.0, so if you want to slide something particular that value needs to be adopted,

    e.g. to slide between fovmin and fovmax replace "setblend(get(val));" with:

    Code
    sub(fovrange, view.fovmax, view.fovmin);
    mul(newfov, val, fovrange);
    add(newfov, view.fovmin);
    set(view.fov, get(newfov));

    best regards,
    Klaus

  • Thanks, i've got a working zoom slider now, *g*

    but i need one more thing :

    -updating the x position of the slider grip on start and for any event : mouse-wheel zoom or any other zoom change (context menu...etc)
    so i suppose i have to build an action and call her every zoom change..
    and what this action will be ? *confused*

    Thanks

    z

  • Hi,

    the onviewchanged event would need to be used here,

    e.g.

    Code
    <events name="sliderevents" keep="true" onviewchanged="updateslider();" />
    
    
    <action name="updateslider">
      sub(val, view.fov, view.fovmin);
      sub(fovrange, view.fovmax, view.fovmin);
      div(val, fovrange);
      mul(plugin[slider_grip].x, val, plugin[slider_bg].pixelwidth);
    </action>

    btw - I have moved this topic from the feature request forum to the normal viewer forum, because that's not directly a feature request

    best regards,
    Klaus

  • Wow cool *thumbsup*
    works fine !

    thanks Klaus,

    and to setup a vertical slider ?
    i've tried to replace all "x" values with "y" and "width" references with "height"
    but i miss something as the dragging not usable *confused*

    Thanks again,
    this last point is not urgent yet.

    z

  • well i got this :

    but i still use the horizontal slider UI with " rotate="90" " - may be i should use a vertical graphic version ?

    see ya.

    z

  • Hi,

    when using rotate="90" keep using x and width for the slider_grip with the exception for 'mouse.stagey',

    the slider_grip is a child from the rotated slider_bg element and so it's own child coordinate system is still unrotated,

    best regards,
    Klaus

  • Hi,

    ok i got it *thumbsup*


    but i'm using a vertical slider graphic instead of rotating the horizontal slider graphic .


    thanks

    z

    Edited 2 times, last by zadda (April 12, 2012 at 10:47 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!