KKControlPadBehavior Class Reference
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
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