Skip to content

Slider class

Pegacraffft edited this page Jan 14, 2021 · 2 revisions

Slider Class

This object can be used to create a slider in a scene. It can be used for a volume slider, or similar things.

Initialisation

The constructor takes an x , and y position, as well as the scene it is created in.

Example:

//Initialisation of the slider object
Slider slider = new Slider(100, 100, scene); //x: 100, y: 100, scene: the scene (if you initialize it in a scene class, use "this")

//add the slider to the scene
addObject(slider);

Getter and setter

getSliderPos()

returns the current slider position as a double.

barAlpha(int barAlpha)

sets the opacity of the bar.

sliderColor(Color color)

sets the color of the slider.

barLength(int barLength)

sets the length of the bar in pixels.

barColor(Color color)

sets the color of the bar.

barThickness(int thickness)

sets the thickness of the bar.

sliderHeight(int sliderHeight)

sets the height of the slider.

sliderWidth(int sliderWidth)

sets the width of the slider.

sliderPosition(double sliderPosition)

sets the slider position.

Clone this wiki locally