Class SliderAttribute
- Namespace
- Nautilus.Options.Attributes
- Assembly
- Nautilus.dll
Attribute used to signify the specified float, double or int should be represented
in the mod's option menu as a ModSliderOption.
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)]
public sealed class SliderAttribute : ModOptionAttribute, _Attribute
- Inheritance
-
SliderAttribute
- Implements
- Inherited Members
- Extension Methods
Examples
using Nautilus.Json;
using Nautilus.Options;
[Menu("My Options Menu")]
public class Config : ConfigFile
{
[Slider("My Slider", 0, 50, DefaultValue = 25, Format = "{0:F2}")]
public float MySlider;
}
Constructors
SliderAttribute()
Signifies the specified float, double or int should be represented in the mod's
options menu as a ModSliderOption.
public SliderAttribute()
- See Also
SliderAttribute(float, float)
Signifies the specified float, double or int should be represented in the mod's
options menu as a ModSliderOption.
public SliderAttribute(float min, float max)
Parameters
- See Also
SliderAttribute(string)
Signifies the specified float, double or int should be represented in the mod's
options menu as a ModSliderOption.
public SliderAttribute(string label = null)
Parameters
labelstring- The label for the slider. If none is set, the name of the method will be used.
- See Also
SliderAttribute(string, float, float)
Signifies the specified float, double or int should be represented in the mod's
options menu as a ModSliderOption.
public SliderAttribute(string label, float min, float max)
Parameters
labelstring- The label for the slider. If none is set, the name of the method will be used.
minfloat- The minimum value of the slider.
maxfloat- The maximum value of the slider.
- See Also
Properties
DefaultValue
The default value of the slider.
public float DefaultValue { get; set; }
Property Value
- See Also
Format
The format to use when displaying the value, e.g. "{0:F2}" or "{0:F0} %"
public string Format { get; set; }
Property Value
- See Also
Max
The maximum value of the slider.
public float Max { get; set; }
Property Value
- See Also
Min
The minimum value of the slider.
public float Min { get; set; }
Property Value
- See Also
Step
The step to apply to the slider (ie. round to nearest)
public float Step { get; set; }
Property Value
- See Also