Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
MoreMountains.Tools.MMInput.IMButton Class Reference

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
virtual bool ButtonUpRecently (float time)
 returns true if this button was released within the time (in unscaled seconds) passed in parameters
 IMButton (string playerID, string buttonID, ButtonDownMethodDelegate btnDown=null, ButtonPressedMethodDelegate btnPressed=null, ButtonUpMethodDelegate btnUp=null)
 Constructor.
virtual void TriggerButtonDown ()
 Presses the button for the first time, putting it in ButtonDown state.
virtual void TriggerButtonPressed ()
 Puts the button in the Pressed state, potentially bypassing the Down state.
virtual void TriggerButtonUp ()
 Puts the button in the Up state.

Public Attributes

string ButtonID
 the unique ID of this button
ButtonDownMethodDelegate ButtonDownMethod
ButtonPressedMethodDelegate ButtonPressedMethod
ButtonUpMethodDelegate ButtonUpMethod

Protected Attributes

float _lastButtonDownAt
float _lastButtonUpAt

Properties

MMStateMachine< MMInput.ButtonStatesState [get, protected set]
 a state machine used to store button states
virtual float TimeSinceLastButtonDown [get]
 returns the time (in unscaled seconds) since the last time the button was pressed down
virtual float TimeSinceLastButtonUp [get]
 returns the time (in unscaled seconds) since the last time the button was released
virtual bool IsPressed [get]
 Returns true if the button is currently pressed.
virtual bool IsDown [get]
 Returns true if the button is down this frame.
virtual bool IsUp [get]
 Returns true if the button is up this frame.
virtual bool IsOff [get]
 Returns true if the button is neither pressed, down or up this frame.

Detailed Description

IM button, short for InputManager button, a class used to handle button states, whether mobile or actual keys.

Constructor & Destructor Documentation

◆ IMButton()

MoreMountains.Tools.MMInput.IMButton.IMButton ( string playerID,
string buttonID,
ButtonDownMethodDelegate btnDown = null,
ButtonPressedMethodDelegate btnPressed = null,
ButtonUpMethodDelegate btnUp = null )

Constructor.

Parameters
playerID
buttonID
btnDown
btnPressed
btnUp

Member Function Documentation

◆ ButtonDownMethodDelegate()

delegate void MoreMountains.Tools.MMInput.IMButton.ButtonDownMethodDelegate ( )

◆ ButtonDownRecently()

virtual bool MoreMountains.Tools.MMInput.IMButton.ButtonDownRecently ( float time)
virtual

returns true if this button was pressed down within the time (in unscaled seconds) passed in parameters

◆ ButtonPressedMethodDelegate()

delegate void MoreMountains.Tools.MMInput.IMButton.ButtonPressedMethodDelegate ( )

◆ ButtonUpMethodDelegate()

delegate void MoreMountains.Tools.MMInput.IMButton.ButtonUpMethodDelegate ( )

◆ ButtonUpRecently()

virtual bool MoreMountains.Tools.MMInput.IMButton.ButtonUpRecently ( float time)
virtual

returns true if this button was released within the time (in unscaled seconds) passed in parameters

◆ TriggerButtonDown()

virtual void MoreMountains.Tools.MMInput.IMButton.TriggerButtonDown ( )
virtual

Presses the button for the first time, putting it in ButtonDown state.

◆ TriggerButtonPressed()

virtual void MoreMountains.Tools.MMInput.IMButton.TriggerButtonPressed ( )
virtual

Puts the button in the Pressed state, potentially bypassing the Down state.

◆ TriggerButtonUp()

virtual void MoreMountains.Tools.MMInput.IMButton.TriggerButtonUp ( )
virtual

Puts the button in the Up state.

Member Data Documentation

◆ _lastButtonDownAt

float MoreMountains.Tools.MMInput.IMButton._lastButtonDownAt
protected

◆ _lastButtonUpAt

float MoreMountains.Tools.MMInput.IMButton._lastButtonUpAt
protected

◆ ButtonDownMethod

ButtonDownMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonDownMethod

◆ ButtonID

string MoreMountains.Tools.MMInput.IMButton.ButtonID

the unique ID of this button

◆ ButtonPressedMethod

ButtonPressedMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonPressedMethod

◆ ButtonUpMethod

ButtonUpMethodDelegate MoreMountains.Tools.MMInput.IMButton.ButtonUpMethod

Property Documentation

◆ IsDown

virtual bool MoreMountains.Tools.MMInput.IMButton.IsDown
get

Returns true if the button is down this frame.

◆ IsOff

virtual bool MoreMountains.Tools.MMInput.IMButton.IsOff
get

Returns true if the button is neither pressed, down or up this frame.

◆ IsPressed

virtual bool MoreMountains.Tools.MMInput.IMButton.IsPressed
get

Returns true if the button is currently pressed.

◆ IsUp

virtual bool MoreMountains.Tools.MMInput.IMButton.IsUp
get

Returns true if the button is up this frame.

◆ State

MMStateMachine<MMInput.ButtonStates> MoreMountains.Tools.MMInput.IMButton.State
getprotected set

a state machine used to store button states

◆ TimeSinceLastButtonDown

virtual float MoreMountains.Tools.MMInput.IMButton.TimeSinceLastButtonDown
get

returns the time (in unscaled seconds) since the last time the button was pressed down

◆ TimeSinceLastButtonUp

virtual float MoreMountains.Tools.MMInput.IMButton.TimeSinceLastButtonUp
get

returns the time (in unscaled seconds) since the last time the button was released


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/feel/Assets/Feel/MMTools/Core/MMHelpers/MMInput.cs