Method - Slider.AddSetting

Updated 2 months ago

Signature

public static Slider.Setting AddSetting(string name, string description, float minValue, float maxValue, float defaultValue, [int decimalPlaces = 0])

Description

Adds an option to the slider.

Parameters

name: The name displayed in the F10 menu for your option.
description: The description displayed in the F10 menu.
minValue: The minimum value the player will be able to choose with the slider.
maxValue: The maximum value the player will be able to choose with the slider.
defaultValue: The value the slider starts at. If you're saving this setting's value, you should probably use that saved value rather than a constant.
decimalPlaces: The number of decimal places in values returned by the slider.

Return Value

Slider.Setting An object for getting/setting the slider's value etc.

Example

Slider.Setting voiceSlider = Slider.AddSetting("Voice Volume", "Range: 0%-400%", 0.0f, 4.0f, audioConfig.VoiceVolume, 2);