C# Class Nez.UI.Button

Inheritance: Table, IInputListener, IGamepadFocusable
Mostra file Open project: prime31/Nez Class Usage Examples

Public Properties

Property Type Description
buttonBoundaryThreshold float
programmaticChangeEvents bool

Protected Properties

Property Type Description
_isChecked bool
_isDisabled bool
_mouseOver bool

Public Methods

Method Description
Button ( ButtonStyle style ) : System
Button ( IDrawable up ) : System
Button ( IDrawable up, IDrawable down ) : System
Button ( IDrawable up, IDrawable down, IDrawable checked_ ) : System
Button ( Skin skin, string styleName = null ) : System
IGamepadFocusable ( ) : void
IGamepadFocusable ( Direction direction ) : void
IInputListener ( ) : void
IInputListener ( Vector2 mousePos ) : void
ToString ( ) : string
draw ( Graphics graphics, float parentAlpha ) : void
enableExplicitFocusableControl ( IGamepadFocusable upEle, IGamepadFocusable downEle, IGamepadFocusable leftEle, IGamepadFocusable rightEle ) : void
getButtonGroup ( ) : ButtonGroup

May be null

getDisabled ( ) : bool
getStyle ( ) : ButtonStyle

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

setChecked ( bool isChecked, bool fireEvent ) : void
setDisabled ( bool disabled ) : void
setStyle ( ButtonStyle style ) : void
toggle ( ) : void

Toggles the checked state. This method changes the checked state, which fires a {@link onChangedEvent} (if programmatic change events are enabled), so can be used to simulate a button click.

Protected Methods

Method Description
onActionButtonPressed ( ) : void
onActionButtonReleased ( ) : void
onFocused ( ) : void
onUnfocused ( ) : void

Private Methods

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

Method Details

Button() public method

public Button ( ButtonStyle style ) : System
style ButtonStyle
return System

Button() public method

public Button ( IDrawable up ) : System
up IDrawable
return System

Button() public method

public Button ( IDrawable up, IDrawable down ) : System
up IDrawable
down IDrawable
return System

Button() public method

public Button ( IDrawable up, IDrawable down, IDrawable checked_ ) : System
up IDrawable
down IDrawable
checked_ IDrawable
return System

Button() public method

public Button ( Skin skin, string styleName = null ) : System
skin Skin
styleName string
return System

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

ToString() public method

public ToString ( ) : string
return string

draw() public method

public draw ( Graphics graphics, float parentAlpha ) : void
graphics Graphics
parentAlpha float
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

getButtonGroup() public method

May be null
public getButtonGroup ( ) : ButtonGroup
return ButtonGroup

getDisabled() public method

public getDisabled ( ) : bool
return bool

getStyle() public method

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

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

setChecked() public method

public setChecked ( bool isChecked, bool fireEvent ) : void
isChecked bool
fireEvent bool
return void

setDisabled() public method

public setDisabled ( bool disabled ) : void
disabled bool
return void

setStyle() public method

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

toggle() public method

Toggles the checked state. This method changes the checked state, which fires a {@link onChangedEvent} (if programmatic change events are enabled), so can be used to simulate a button click.
public toggle ( ) : void
return void

Property Details

_isChecked protected_oe property

protected bool _isChecked
return bool

_isDisabled protected_oe property

protected bool _isDisabled
return bool

_mouseOver protected_oe property

protected bool _mouseOver
return bool

buttonBoundaryThreshold public_oe property

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

programmaticChangeEvents public_oe property

public bool programmaticChangeEvents
return bool