Inherits from KKBehavior
Declared in KKControlPadBehavior.h

Overview

Emulates a digital control pad (d-pad), updates its node with textures based on the direction. Sends a KKControlPadDidChangeDirection notification every time direction changes.

Warning: Caution: Only works on SKSpriteNode classes!

Properties

deadZone

Deadzone defines the radius around the d-pad center where no direction change occurs. Defaults to 10 points.

@property (atomic) CGFloat deadZone

Declared In

KKControlPadBehavior.h

direction

The D-Pad direction, in KTArcadeInputState directions (using player 1 states).

@property (atomic, readonly) KKArcadeInputState direction

Declared In

KKControlPadBehavior.h

vertical

For 2-way dpads specifies that the layout is vertical (up/down) instead of the default horizontal (left/right) layout.

@property (atomic) BOOL vertical

Declared In

KKControlPadBehavior.h

Class Methods

controlPadBehaviorWithTextures:

Initializes a control pad behavior with either 4 or 8 d-pad directional textures. Start with the texture for “right button pressed” and continue adding textures in counter-clockwise order (ie “upper right button pressed”, “up button pressed”, and so on). The “idle” state is the texture the sprite has been initialized with.

+ (id)controlPadBehaviorWithTextures:(NSArray *)textures

Parameters

textures

The textures to use for the different dpad directional states.

Return Value

A new instance.

Declared In

KKControlPadBehavior.h