TriggerPressListener

Description

A class that checks to see if the Trigger has been pressed (when the state goes down to up).

Relationships

Members

  • bool isRightTrigger - whether we should check the right or left trigger
  • bool isTriggerDown - whether the trigger is pass the threshold or not
  • float threshold - when then value surpasses the threshold, the state is then down.

Methods

  • Update(GamePadState padState)
    • check what state the Trigger is in through padState, then call the delegate that corresponds to the state
  • TriggerPressListener(bool useRightTrigger, float triggerThreshold, ButtonEvent upFunc, ButtonEvent downFunc):base(Buttons.A, upFunc, downFunc)
    • Constructor that accepts a trigger bool, a threshold to when the event should start checking, what happens when the trigger is up and what happens when the trigger is pressed. Buttons.A is passed to constructor for arbitrary value and then never used again.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License