iOS Developer Library — Pre-Release

Developer

SpriteKit Framework Reference SKReachConstraints Class Reference

Options
Deployment Target:

On This Page
Language:

SKReachConstraints

An SKReachConstraints object is used to describe the range of motion for an SKNode object whenever an inverse kinematic (IK) action is executed. More...

Inheritance


Conforms To


Import Statement


Swift

import SpriteKit

Objective-C

@import SpriteKit;

Availability


Available in iOS 8.0 and later.
  • Initializes a new reach constraint object.

    Declaration

    Swift

    init(lowerAngleLimit lowerAngleLimit: CGFloat, upperAngleLimit upperAngleLimit: CGFloat)

    Objective-C

    - (instancetype)initWithLowerAngleLimit:(CGFloat)lowerAngleLimit upperAngleLimit:(CGFloat)upperAngleLimit

    Parameters

    lowerAngleLimit

    The minimum angle that the node can have when it is rotated by a reach event.

    upperAngleLimit

    The maximum angle that the node can have when it is rotated by a reach event.

    Return Value

    A newly initialized reach constraint.

    Discussion

    When a reach action is executed, a node’s zRotation property may be changed by the action to satisfy the reach action. Any value calculated by the reach action for a node is always inside the range specified by the reach constraint attached to the node’s reachConstraints property.

    Import Statement

    Swift

    import SpriteKit

    Availability

    Available in iOS 8.0 and later.

  • The minimum angle that the node can have after it is rotated by a reach event.

    Declaration

    Swift

    var lowerAngleLimit: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat lowerAngleLimit

    Import Statement

    Swift

    import SpriteKit

    Availability

    Available in iOS 8.0 and later.

  • The maximum angle that the node can have after it is rotated by a reach event.

    Declaration

    Swift

    var upperAngleLimit: CGFloat

    Objective-C

    @property(nonatomic, assign) CGFloat upperAngleLimit

    Import Statement

    Swift

    import SpriteKit

    Availability

    Available in iOS 8.0 and later.