Skip to content

Class endstone::Slider

ClassList > endstone > Slider

Represents a slider with a label.

  • #include <endstone/form/controls/slider.h>

Public Functions

Type Name
Slider () = default
Slider (Message label, float min, float max, float step, std::optional< float > default_value=std::nullopt)
std::optional< float > getDefaultValue () const
Gets the default value of the slider.
Message getLabel () const
Gets the label of the toggle.
float getMax () const
Gets the maximum value of the slider.
float getMin () const
Gets the minimum value of the slider.
float getStep () const
Gets the step size of the slider.
Slider & setDefaultValue (std::optional< float > default_value)
Sets the default value of the slider.
Slider & setLabel (Message label)
Sets the label of the toggle.
Slider & setMax (float max)
Sets the maximum value of the slider.
Slider & setMin (float min)
Sets the minimum value of the slider.
Slider & setStep (float step)
Sets the step size of the slider.

Public Functions Documentation

function Slider [½]

endstone::Slider::Slider () = default

function Slider [2/2]

inline explicit endstone::Slider::Slider (
    Message label,
    float min,
    float max,
    float step,
    std::optional< float > default_value=std::nullopt
) 

function getDefaultValue

Gets the default value of the slider.

inline std::optional< float > endstone::Slider::getDefaultValue () const

Returns:

The default value of the slider.


function getLabel

Gets the label of the toggle.

inline Message endstone::Slider::getLabel () const

Returns:

The label of the toggle.


function getMax

Gets the maximum value of the slider.

inline float endstone::Slider::getMax () const

Returns:

The maximum value of the slider.


function getMin

Gets the minimum value of the slider.

inline float endstone::Slider::getMin () const

Returns:

The minimum value of the slider.


function getStep

Gets the step size of the slider.

inline float endstone::Slider::getStep () const

Returns:

The step size of the slider.


function setDefaultValue

Sets the default value of the slider.

inline Slider & endstone::Slider::setDefaultValue (
    std::optional< float > default_value
) 

Parameters:

  • default_value The new default value for the slider.

Returns:

A reference to the current slider, for function chaining.


function setLabel

Sets the label of the toggle.

inline Slider & endstone::Slider::setLabel (
    Message label
) 

Parameters:

  • label The new label for the toggle.

Returns:

A reference to the current toggle.


function setMax

Sets the maximum value of the slider.

inline Slider & endstone::Slider::setMax (
    float max
) 

Parameters:

  • max The new maximum value for the slider.

Returns:

A reference to the current slider, for function chaining.


function setMin

Sets the minimum value of the slider.

inline Slider & endstone::Slider::setMin (
    float min
) 

Parameters:

  • min The new minimum value for the slider.

Returns:

A reference to the current slider, for function chaining.


function setStep

Sets the step size of the slider.

inline Slider & endstone::Slider::setStep (
    float step
) 

Parameters:

  • step The new step size for the slider.

Returns:

A reference to the current slider, for function chaining.



The documentation for this class was generated from the following file include/endstone/form/controls/slider.h