Author Topic: Changing Variable when Slider changes?  (Read 1768 times)

how do i do that...i cant seem to get it to work

what i want it to do is change the FOV (zoom)
Code: [Select]
      new GuiSliderCtrl(setZoomFOV) {
         profile = "GuiSliderProfile";
         horizSizing = "right";
         vertSizing = "bottom";
         position = "4 321";
         extent = "268 64";
         minExtent = "8 2";
         visible = "1";
         command = "setFov( $Pref::player::CurrentFOV )";
         range = "1.000000 100.000000";
         ticks = "100";
         value = "1";
      };
and i cant get it to work

This post has been made before. Use the search button:

To answer your question, there are 2 ways to manipulate a variable when a Gui slider is changed:

1. This is the simpler method if all you need to do is change a variable:
Code: [Select]
MySlider.variable = $MyVariable;

2. This method is a bit longer, but better if you need to add a command along with a variable update:
Code: [Select]
MySlider.command = "FunctionHere";
function FunctionHere()
{
$MyVariable=MySlider.getValue();
MoreCommandsHere();
}
i did search but it made no sense (the topic i found) thank you!

ok then how do i setup so i does change the FOV (zoom) i cant figure that part out know