Class Slider
The slider control.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class Slider : ContainerControl, IComparable, IDrawable
Constructors
Slider()
Slider(Single, Single)
Initializes a new instance of the Slider class.
Declaration
public Slider(float width, float height)
Parameters
System.Single
width
The width. |
System.Single
height
The height. |
Fields
_maximum
The maximum value.
Declaration
protected float _maximum
Field Value
System.Single
|
_minimum
The minimum value.
Declaration
protected float _minimum
Field Value
System.Single
|
FillTrack
Whether to fill the track.
Declaration
[EditorOrder(42)]
[Tooltip("Fill the track.")]
public bool FillTrack
Field Value
System.Boolean
|
WholeNumbers
Whether to use whole numbers.
Declaration
[EditorOrder(43)]
[Tooltip("Use whole numbers.")]
public bool WholeNumbers
Field Value
System.Boolean
|
Properties
Direction
Gets or sets the slider direction.
Declaration
[EditorOrder(40)]
[Tooltip("Slider Direction.")]
public Slider.SliderDirection Direction { get; set; }
Property Value
Slider.SliderDirection
|
FillTrackBrush
Gets or sets the brush used for slider fill track drawing.
Declaration
[EditorDisplay("Track Style", null)]
[EditorOrder(2013)]
[VisibleIf("FillTrack", false)]
[Tooltip("The brush used for slider fill track drawing.")]
public IBrush FillTrackBrush { get; set; }
Property Value
IBrush
|
Maximum
Gets or sets the maximum value.
Declaration
[EditorOrder(30)]
[Tooltip("The maximum value.")]
public float Maximum { get; set; }
Property Value
System.Single
|
Minimum
Gets or sets the minimum value.
Declaration
[EditorOrder(20)]
[Tooltip("The minimum value.")]
public float Minimum { get; set; }
Property Value
System.Single
|
ThumbBrush
Gets or sets the brush used for slider thumb drawing.
Declaration
[EditorDisplay("Thumb Style", null)]
[EditorOrder(2033)]
[Tooltip("The brush of the slider thumb.")]
public IBrush ThumbBrush { get; set; }
Property Value
IBrush
|
ThumbColor
The color of the slider thumb when it's not selected.
Declaration
[EditorDisplay("Thumb Style", null)]
[EditorOrder(2030)]
[Tooltip("The color of the slider thumb when it's not selected.")]
[ExpandGroups]
public Color ThumbColor { get; set; }
Property Value
Color
|
ThumbColorHighlighted
The color of the slider thumb when it's highlighted.
Declaration
[EditorDisplay("Thumb Style", null)]
[EditorOrder(2031)]
[Tooltip("The color of the slider thumb when it's highlighted.")]
public Color ThumbColorHighlighted { get; set; }
Property Value
Color
|
ThumbColorSelected
The color of the slider thumb when it's selected.
Declaration
[EditorDisplay("Thumb Style", null)]
[EditorOrder(2032)]
[Tooltip("The color of the slider thumb when it's selected.")]
public Color ThumbColorSelected { get; set; }
Property Value
Color
|
ThumbSize
The thumb size.
Declaration
[EditorOrder(41)]
[Tooltip("The size of the thumb.")]
public Float2 ThumbSize { get; set; }
Property Value
Float2
|
TrackBrush
Gets or sets the brush used for slider track drawing.
Declaration
[EditorDisplay("Track Style", null)]
[EditorOrder(2012)]
[Tooltip("The brush used for slider track drawing.")]
public IBrush TrackBrush { get; set; }
Property Value
IBrush
|
TrackFillLineColor
The color of the slider fill track line
Declaration
[EditorDisplay("Track Style", null)]
[EditorOrder(2011)]
[VisibleIf("FillTrack", false)]
[Tooltip("The color of the slider fill track line.")]
public Color TrackFillLineColor { get; set; }
Property Value
Color
|
TrackLineColor
The color of the slider track line
Declaration
[EditorDisplay("Track Style", null)]
[EditorOrder(2010)]
[Tooltip("The color of the slider track line.")]
[ExpandGroups]
public Color TrackLineColor { get; set; }
Property Value
Color
|
TrackThickness
The height of the track.
Declaration
[EditorOrder(40)]
[Tooltip("The track height.")]
public int TrackThickness { get; set; }
Property Value
System.Int32
|
Value
Gets or sets the value (normalized to range 0-100).
Declaration
[EditorOrder(10)]
[Tooltip("The current value.")]
public float Value { get; set; }
Property Value
System.Single
|
Methods
Draw()
Draw the control and the children.
Declaration
public override void Draw()
Overrides
OnEndMouseCapture()
When mouse goes up/down not over the control but it has user focus so remove that focus from it (used by scroll bars, sliders etc.)
Declaration
public override void OnEndMouseCapture()
Overrides
OnLostFocus()
When control losts input focus
Declaration
public override void OnLostFocus()
Overrides
OnMouseDown(Float2, MouseButton)
When mouse goes down over control's area
Declaration
public override bool OnMouseDown(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnMouseMove(Float2)
When mouse moves over control's area
Declaration
public override void OnMouseMove(Float2 location)
Parameters
Float2
location
Mouse location in Control Space |
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnSizeChanged()
Called when control size gets changed.
Declaration
protected override void OnSizeChanged()
Overrides
Events
SlidingEnd
Occurs when sliding ends.
Declaration
public event Action SlidingEnd
Event Type
System.Action
|
SlidingStart
Occurs when sliding starts.
Declaration
public event Action SlidingStart
Event Type
System.Action
|
ValueChanged
Occurs when value gets changed.
Declaration
public event Action ValueChanged
Event Type
System.Action
|