Type Alias

GCControllerButtonValueChangedHandler

Signature for the block executed if a button changes values.

Declaration

typealias GCControllerButtonValueChangedHandler = (GCControllerButtonInput, Float, Bool) -> Void

Discussion

The block parameters are defined as follows:

button

The button element whose value changed.

value

The amount of pressure being applied to the button. This value is used in conjunction with the pressed parameter. If pressure is being applied to the button, then the pressed parameter is true and this parameter indicates the amount of pressure being applied to the button. The pressure value is normalized to a number between 0.0 (minimum pressure) and 1.0 (maximum pressure).

If no pressure is being applied to the button, then the pressed parameter is false and this parameter holds a value of 0.0.

pressed

A Boolean value that indicates whether the button is considered pressed.

This block type is used by the valueChangedHandler and pressedChangedHandler properties.