public class ControllerDirectionControl extends ControllerControl
A ControllerDirectionControl is a ControllerControl that represents a Direction - up, down, left, or right - in which the primary axes of a game controller can be moved. A controller's primary axes are typically those of a directional pad or left control stick. A ControllerDirectionControl is considered pressed when the axes are moved into its Direction, relative to their neutral position, and released when they are moved out of its Direction. The axes can be in a pair of adjacent Directions, such as up and right, at the same time.
Direction
MAX_CONTROLLERS
Constructor and Description |
---|
ControllerDirectionControl(int controllerNum,
Direction direction)
Constructs a ControllerDirectionControl that represents the specified
Direction on the primary axes of the controller with the specified
number.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Returns whether the specified object is a ControllerDirectionControl that
is equal to this ControllerDirectionControl.
|
Direction |
getDirection()
Returns this ControllerButtonControl's Direction.
|
java.lang.String |
getName()
Returns a short, descriptive, and unique String name for this Control.
|
int |
hashCode() |
getControllerNum
getControl
public ControllerDirectionControl(int controllerNum, Direction direction) throws InvalidControlException
controllerNum
- The number of this ControllerDirectionControl's
controllerdirection
- This ControllerDirectionControl's DirectionInvalidControlException
- if the specified controller number is
invalid or the specified Direction is nullpublic final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object to be compared with this ControllerDirectionControlpublic java.lang.String getName()
Control
public final Direction getDirection()