Corgi Engine
v9.1
|
IM button, short for InputManager button, a class used to handle button states, whether mobile or actual keys More...
Public Member Functions | |
delegate void | ButtonDownMethodDelegate () |
delegate void | ButtonPressedMethodDelegate () |
delegate void | ButtonUpMethodDelegate () |
virtual bool | ButtonDownRecently (float time) |
returns true if this button was pressed down within the time (in unscaled seconds) passed in parameters More... | |
virtual bool | ButtonUpRecently (float time) |
returns true if this button was released within the time (in unscaled seconds) passed in parameters More... | |
IMButton (string playerID, string buttonID, ButtonDownMethodDelegate btnDown=null, ButtonPressedMethodDelegate btnPressed=null, ButtonUpMethodDelegate btnUp=null) | |
Constructor More... | |
virtual void | TriggerButtonDown () |
Presses the button for the first time, putting it in ButtonDown state More... | |
virtual void | TriggerButtonPressed () |
Puts the button in the Pressed state, potentially bypassing the Down state More... | |
virtual void | TriggerButtonUp () |
Puts the button in the Up state More... | |
Public Attributes | |
string | ButtonID |
the unique ID of this button More... | |
ButtonDownMethodDelegate | ButtonDownMethod |
ButtonPressedMethodDelegate | ButtonPressedMethod |
ButtonUpMethodDelegate | ButtonUpMethod |
virtual bool | IsPressed => State.CurrentState == MMInput.ButtonStates.ButtonPressed |
Returns true if the button is currently pressed More... | |
virtual bool | IsDown => State.CurrentState == MMInput.ButtonStates.ButtonDown |
Returns true if the button is down this frame More... | |
virtual bool | IsUp => State.CurrentState == MMInput.ButtonStates.ButtonUp |
Returns true if the button is up this frame More... | |
virtual bool | IsOff => State.CurrentState == MMInput.ButtonStates.Off |
Returns true if the button is neither pressed, down or up this frame More... | |
Protected Attributes | |
float | _lastButtonDownAt |
float | _lastButtonUpAt |
Properties | |
MMStateMachine< MMInput.ButtonStates > | State [get, protected set] |
a state machine used to store button states More... | |
virtual float | TimeSinceLastButtonDown [get] |
returns the time (in unscaled seconds) since the last time the button was pressed down More... | |
virtual float | TimeSinceLastButtonUp [get] |
returns the time (in unscaled seconds) since the last time the button was released More... | |
IM button, short for InputManager button, a class used to handle button states, whether mobile or actual keys
MoreMountains.Tools.MMInput.IMButton.IMButton | ( | string | playerID, |
string | buttonID, | ||
ButtonDownMethodDelegate | btnDown = null , |
||
ButtonPressedMethodDelegate | btnPressed = null , |
||
ButtonUpMethodDelegate | btnUp = null |
||
) |
Constructor
playerID | |
buttonID | |
btnDown | |
btnPressed | |
btnUp |
delegate void MoreMountains.Tools.MMInput.IMButton.ButtonDownMethodDelegate | ( | ) |
|
virtual |
returns true if this button was pressed down within the time (in unscaled seconds) passed in parameters
delegate void MoreMountains.Tools.MMInput.IMButton.ButtonPressedMethodDelegate | ( | ) |
delegate void MoreMountains.Tools.MMInput.IMButton.ButtonUpMethodDelegate | ( | ) |
|
virtual |
returns true if this button was released within the time (in unscaled seconds) passed in parameters
|
virtual |
Presses the button for the first time, putting it in ButtonDown state
|
virtual |
Puts the button in the Pressed state, potentially bypassing the Down state
|
virtual |
Puts the button in the Up state
|
protected |
|
protected |
ButtonDownMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonDownMethod |
string MoreMountains.Tools.MMInput.IMButton.ButtonID |
the unique ID of this button
ButtonPressedMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonPressedMethod |
ButtonUpMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonUpMethod |
virtual bool MoreMountains.Tools.MMInput.IMButton.IsDown => State.CurrentState == MMInput.ButtonStates.ButtonDown |
Returns true if the button is down this frame
virtual bool MoreMountains.Tools.MMInput.IMButton.IsOff => State.CurrentState == MMInput.ButtonStates.Off |
Returns true if the button is neither pressed, down or up this frame
virtual bool MoreMountains.Tools.MMInput.IMButton.IsPressed => State.CurrentState == MMInput.ButtonStates.ButtonPressed |
Returns true if the button is currently pressed
virtual bool MoreMountains.Tools.MMInput.IMButton.IsUp => State.CurrentState == MMInput.ButtonStates.ButtonUp |
Returns true if the button is up this frame
|
getprotected set |
a state machine used to store button states
|
get |
returns the time (in unscaled seconds) since the last time the button was pressed down
|
get |
returns the time (in unscaled seconds) since the last time the button was released