|
|
Source code |
1 2 3 4 |
sub(fovrange, view.fovmax, view.fovmin); mul(newfov, val, fovrange); add(newfov, view.fovmin); set(view.fov, get(newfov)); |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<!-- ############################################# # 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 --> |
|
|
Source code |
1 2 3 4 5 6 7 8 |
<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> |

|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<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();" /> |
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<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();" /> |
This post has been edited 2 times, last edit by "zadda" (Apr 12th 2012, 10:47am)