InputComponent

Description

An abstract class that will be inherited by all listeners. Holds all needed methods and attributes that all listeners share.

Relationships

Members

  • delegate ButtonEvent() - delegate that holds the function to call for anything dealing with buttons, triggers, and thumbsticks
  • delegate TriggerEvent(float degree) - delegate that holds the function to call for trigger pressure (for soft-possession control)
  • ButtonEvent downFunction - function to call when the button is down
  • ButtonEvent upFunction - function to call when the button is up
  • TriggerEvent downFunction - function to call when the trigger is down
  • TriggerEvent upFunction - function to call when the trigger is up
  • Buttons currentButton - what button we're checking
  • bool isStateUp - if the state of the button/trigger is up or down

Methods

  • Update(GamePadState padState)
    • abstract update that won't do anything - padState is needed to check what state the Button/Trigger is in.
  • InputComponent(Buttons buttonToCheck, ButtonEvent upFunc, ButtonEvent downFunc)
    • Constructor that accepts a button, what happens when the button is up and what happens when the button is pressed
  • InputComponent(bool useRightTrigger, float triggerThreshold, TriggerEvent upFunc, TriggerEvent downFunc)
    • Constructor that accepts a trigger, a threshold for when the event should fire, what happens when the trigger is up and what happens when the trigger is being pressed
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License