iOS Developer Library

Developer

SpriteKit Framework Reference SKPhysicsJointFixed Class Reference

Options
Deployment Target:

On This Page
Language:

SKPhysicsJointFixed

Inheritance


Conforms To


Import Statement


Swift

import SpriteKit

Objective-C

@import SpriteKit;

Availability


Available in iOS 7.0 and later.

An SKPhysicsJointFixed object fuses two physics bodies together at a reference point. Fixed joints are useful for creating complex shapes that can be broken apart later.

  • Creates a new physics joint.

    Declaration

    Swift

    class func jointWithBodyA(_ bodyA: SKPhysicsBody!, bodyB bodyB: SKPhysicsBody!, anchor anchor: CGPoint) -> SKPhysicsJointFixed!

    Objective-C

    + (SKPhysicsJointFixed *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchor:(CGPoint)anchor

    Parameters

    bodyA

    The first body to connect. The body must be connected to a node that is already part of the scene’s node tree.

    bodyB

    The second body to connect. The body must be connected to a node that is already part of the scene’s node tree.

    anchor

    The anchor point for the connection in the scene’s coordinate system.

    Return Value

    A new physics joint.

    Discussion

    You must add the joint to a physics world associated with the scene before it takes effect.

    Import Statement

    Objective-C

    @import SpriteKit;

    Swift

    import SpriteKit

    Availability

    Available in iOS 7.0 and later.