Class

GCControllerElement

A GCControllerElement object represents a measurable value on a controller profile. Typically, elements are mapped to physical controls on a controller. When a player manipulates those controls, the element object’s values change. The GCControllerElement class is never instantiated directly. Instead, subclasses that represent the different kinds of elements are instantiated. Table 1 lists the supported element types.

Overview

Table 1

Kinds of controller elements

Class

Description

GCControllerAxisInput

An element that measures movement along an axis.

GCControllerButtonInput

An element that measures a button press.

GCControllerDirectionPad

An element that measures movement across two different axes.

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 isAnalog property determines whether the element returns a range of values or discrete (digital) values.

Symbols

Inspecting Element Properties

var isAnalog: Bool

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

var collection: GCControllerElement?

Returns the element that this element is part of.

Relationships

Inherits From

Conforms To