C# Class Nez.UI.Slider

Inheritance: ProgressBar, IInputListener, IGamepadFocusable
Show file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
sliderBoundaryThreshold float

Public Methods

Method Description
IGamepadFocusable ( ) : void
IGamepadFocusable ( Direction direction ) : void
IInputListener ( ) : void
IInputListener ( Vector2 mousePos ) : void
Slider ( Skin skin, string styleName = null, float min, float max = 1, float step = 0.1f ) : System
Slider ( float min, float max, float stepSize, bool vertical, SliderStyle style ) : System

Creates a new slider. It's width is determined by the given prefWidth parameter, its height is determined by the maximum of the height of either the slider {@link NinePatch} or slider handle {@link TextureRegion}. The min and max values determine the range the values of this slider can take on, the stepSize parameter specifies the distance between individual values. E.g. min could be 4, max could be 10 and stepSize could be 0.2, giving you a total of 30 values, 4.0 4.2, 4.4 and so on.

calculatePositionAndValue ( Vector2 mousePos ) : void
enableExplicitFocusableControl ( IGamepadFocusable upEle, IGamepadFocusable downEle, IGamepadFocusable leftEle, IGamepadFocusable rightEle ) : void
getStyle ( ) : SliderStyle

Returns the slider's style. Modifying the returned style may not have an effect until {@link #setStyle(SliderStyle)} is called

isDragging ( ) : bool
setStyle ( SliderStyle style ) : void

Protected Methods

Method Description
getKnobDrawable ( ) : IDrawable
onActionButtonPressed ( ) : void
onActionButtonReleased ( ) : void
onFocused ( ) : void
onUnfocused ( ) : void
onUnhandledDirectionPressed ( Direction direction ) : void

Private Methods

Method Description
IInputListener ( Vector2 mousePos ) : bool
IInputListener ( int mouseWheelDelta ) : bool

Method Details

IGamepadFocusable() public method

public IGamepadFocusable ( ) : void
return void

IGamepadFocusable() public method

public IGamepadFocusable ( Direction direction ) : void
direction Direction
return void

IInputListener() public method

public IInputListener ( ) : void
return void

IInputListener() public method

public IInputListener ( Vector2 mousePos ) : void
mousePos Vector2
return void

Slider() public method

public Slider ( Skin skin, string styleName = null, float min, float max = 1, float step = 0.1f ) : System
skin Skin
styleName string
min float
max float
step float
return System

Slider() public method

Creates a new slider. It's width is determined by the given prefWidth parameter, its height is determined by the maximum of the height of either the slider {@link NinePatch} or slider handle {@link TextureRegion}. The min and max values determine the range the values of this slider can take on, the stepSize parameter specifies the distance between individual values. E.g. min could be 4, max could be 10 and stepSize could be 0.2, giving you a total of 30 values, 4.0 4.2, 4.4 and so on.
public Slider ( float min, float max, float stepSize, bool vertical, SliderStyle style ) : System
min float Minimum.
max float Max.
stepSize float Step size.
vertical bool If set to true vertical.
style SliderStyle
return System

calculatePositionAndValue() public method

public calculatePositionAndValue ( Vector2 mousePos ) : void
mousePos Vector2
return void

enableExplicitFocusableControl() public method

public enableExplicitFocusableControl ( IGamepadFocusable upEle, IGamepadFocusable downEle, IGamepadFocusable leftEle, IGamepadFocusable rightEle ) : void
upEle IGamepadFocusable
downEle IGamepadFocusable
leftEle IGamepadFocusable
rightEle IGamepadFocusable
return void

getKnobDrawable() protected method

protected getKnobDrawable ( ) : IDrawable
return IDrawable

getStyle() public method

Returns the slider's style. Modifying the returned style may not have an effect until {@link #setStyle(SliderStyle)} is called
public getStyle ( ) : SliderStyle
return SliderStyle

isDragging() public method

public isDragging ( ) : bool
return bool

onActionButtonPressed() protected method

protected onActionButtonPressed ( ) : void
return void

onActionButtonReleased() protected method

protected onActionButtonReleased ( ) : void
return void

onFocused() protected method

protected onFocused ( ) : void
return void

onUnfocused() protected method

protected onUnfocused ( ) : void
return void

onUnhandledDirectionPressed() protected method

protected onUnhandledDirectionPressed ( Direction direction ) : void
direction Direction
return void

setStyle() public method

public setStyle ( SliderStyle style ) : void
style SliderStyle
return void

Property Details

sliderBoundaryThreshold public property

the maximum distance outside the slider the mouse can move when pressing it to cause it to be unfocused
public float sliderBoundaryThreshold
return float