SliderRange ?

BlitzPlus Forums/BlitzPlus Programming/SliderRange ?

Red(Posted 2003) [#1]
I don't understand how it works...


SetSliderRange slider, inf , sup ????


Snarty(Posted 2003) [#2]
Ok, say you had an Image which was 640x480, but the canvas or panel area you are viewing the Image through is on 320x240. You would set the vertical and horizontal Sliders as such.

SetSliderRange SliderX,320,640
Where 320 is how much area is visible (the size of the viewable area (panel/Canvas), and 640 is the size of the Image. Then, but using OffsetX=SliderValue(SliderX) would tell you the offset to display the image within the Panel/Canvas.

SetSliderRange SliderY,240,480
And, just like the X range this would be 240 is the height of the Panel/Canvas (visible area again) and 480 is the overall height of the Image in question.

So, with this in mind, you could do the same with list's of text, or silder values where the slider size is free to propertionally change with the window size, and you only want X amount of possible results from the slider. Changing the range, you can limit the output to ensure it only gives values between 0-255 for example.

Have a play, doesn't take long to get the hang of it.


Red(Posted 2003) [#3]
ok I understand now
With a good example. :)