Hi,
How to convert the xml blend slider in Zoom slider ?
Replacing the "setblend" action by a "setfov" and how to achieve that ?
Thankx
z
Hi,
How to convert the xml blend slider in Zoom slider ?
Replacing the "setblend" action by a "setfov" and how to achieve that ?
Thankx
z
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:
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,
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 ?
<!--
#############################################
# PLUGIN FOV SLIDER #
#############################################
-->
<plugin name="slider_bg" url="gfx/slider_background.png" align="bottom" x="0" y="30" handcursor="false" zorder="1" parent="stage"/>
<plugin name="slider_grip" url="gfx/slider_grip.png" align="left" edge="center" parent="slider_bg" x="0" zorder="2"
dragging="if(pressed,
sub(dx, mouse.stagex, drag_stagex);
add(newx, drag_currentx, dx);
if(newx LT 0, set(newx,0));
if(newx GT plugin[slider_bg].pixelwidth, copy(newx,plugin[slider_bg].pixelwidth));
copy(x,newx);
div(val, newx, plugin[slider_bg].pixelwidth);
sub(fovrange, view.fovmax, view.fovmin);
mul(newfov, val, fovrange);
add(newfov, view.fovmin);
set(view.fov, get(newfov));
delayedcall(0,dragging());
);"
ondown="copy(drag_currentx,x); copy(drag_stagex,mouse.stagex); dragging();"
/>
<!-- END plugin slider -->
Display More
Thanks
z
Hi,
the onviewchanged event would need to be used here,
e.g.
<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
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
Thanks again,
this last point is not urgent yet.
z
Hi,
have you really replaced all 'x' occurrences to 'y' (and all 'width' to 'height' of course)?
e.g. also the stagex and so on?
as long as you don't missed one, it should work also vertically of course
best regards,
Klaus
well i got this :
<plugin name="slider_bg" url="gfx/slider_background.png" align="bottom" rotate="90" x="210" y="270" handcursor="false" zorder="1" parent="stage"/>
<plugin name="slider_grip" url="gfx/slider_grip.png" align="left" edge="center" parent="slider_bg" y="0" zorder="2"
dragging="if(pressed,
sub(dy, mouse.stagey, drag_stagey);
add(newy, drag_currenty, dy);
if(newy LT 0, set(newy,0));
if(newy GT plugin[slider_bg].pixelheight, copy(newy,plugin[slider_bg].pixelheight));
copy(y,newy);
div(val, newy, plugin[slider_bg].pixelheight);
sub(fovrange, view.fovmax, view.fovmin);
mul(newfov, val, fovrange);
add(newfov, view.fovmin);
set(view.fov, get(newfov));
delayedcall(0,dragging());
);"
ondown="copy(drag_currenty,y); copy(drag_stagey,mouse.stagey); dragging();"
/>
Display More
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
<plugin name="slider_bg" url="gfx/slider_backgroundv.png" align="bottom" x="220" y="200" handcursor="false" zorder="1" parent="stage"/>
<plugin name="slider_grip" url="gfx/slider_grip.png" align="top" edge="center" parent="slider_bg" y="0" zorder="2"
dragging="if(pressed,
sub(dy, mouse.stagey, drag_stagey);
add(newy, drag_currenty, dy);
if(newy LT 0, set(newy,0));
if(newy GT plugin[slider_bg].pixelheight, copy(newy,plugin[slider_bg].pixelheight));
copy(y,newy);
div(val, newy, plugin[slider_bg].pixelheight);
sub(fovrange, view.fovmax, view.fovmin);
mul(newfov, val, fovrange);
add(newfov, view.fovmin);
set(view.fov, get(newfov));
delayedcall(0,dragging());
);"
ondown="copy(drag_currenty,y); copy(drag_stagey,mouse.stagey); dragging();"
/>
Display More
but i'm using a vertical slider graphic instead of rotating the horizontal slider graphic .
thanks
z
Hi Guys, I also accomplished the transition to vertical slider, but it only works when you drag from top to bottom... I would prefer dragging UP but can not figure out how to invert the drag motion.
Any help?
Thanks
AA
Don’t have an account yet? Register yourself now and be a part of our community!