Class

GCControllerDirectionPad

A control element associated with a directional pad or a thumbstick.

Declaration

class GCControllerDirectionPad : GCControllerElement

Overview

This element does not provide values of its own. Instead, its values are provided by its child elements. It provides two sets of children that map to the same physical controls, so your app can view the directional pad as either either a pair of perpendicular axes (horizontal, vertical), or four button elements (up, down, left, right).

Topics

Reading the Directional Pad as a Pair of Axes

var xAxis: GCControllerAxisInput

The value of the directional pad along the horizontal axis (left and right).

var yAxis: GCControllerAxisInput

The value of the directional pad along the vertical axis (up and down).

Reading the Directional Pad as a Four Directional Buttons

var up: GCControllerButtonInput

A measurement of how far up the directional pad has been moved.

var down: GCControllerButtonInput

A measurement of how far down the directional pad has been moved.

var left: GCControllerButtonInput

A measurement of how far left the directional pad has been moved.

var right: GCControllerButtonInput

A measurement of how far right the directional pad has been moved.

Receiving Notifications When the Directional Pad’s Values Change

var valueChangedHandler: GCControllerDirectionPadValueChangedHandler?

A handler to be called when the directional pad element changes values.

Constants

typealias GCControllerDirectionPadValueChangedHandler

Signature for the block executed when either axis changes values.

Relationships

Inherits From

Conforms To

See Also

Input Elements

class GCControllerElement

An input associated with a physical control, such as a button or thumbstick.

class GCControllerAxisInput

A control element measuring movement along a particular axis.

class GCControllerButtonInput

A control element measuring a button press.