Class

GCController​Element

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

Overview

Elements are mapped to physical controls on a controller. When a player manipulates a control, the corresponding element's values change. This class is never instantiated directly. Instead, subclasses represent different kinds of elements.

An element class usually represents an isolated element, such as a button, whose values can be read. However, an element can itself have child elements. For example, a direction pad is a two-dimensional control whose values can either be read as a pair of axis elements or four button elements. If an element is a child of another element, its collection property points to its parent element.

The is​Analog property determines whether the element returns a range of values or discrete (digital) values.

Symbols

Inspecting Element Properties

var is​Analog:​ Bool

Returns a Boolean value that indicates whether the element provides analog data.

var collection:​ GCController​Element?

Returns the element that this element is part of.

Relationships

Inherits From