SpriteKit.SKPhysicsJointLimit.Create Method
Factory method for creating a rope-like connection between two physics body.

Syntax

[Foundation.Export("jointWithBodyA:bodyB:anchorA:anchorB:")]
public static SKPhysicsJointLimit Create (SKPhysicsBody bodyA, SKPhysicsBody bodyB, CoreGraphics.CGPoint anchorA, CoreGraphics.CGPoint anchorB)

Parameters

bodyA
Documentation for this section has not yet been entered.
bodyB
Documentation for this section has not yet been entered.
anchorA
Documentation for this section has not yet been entered.
anchorB
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

The SpriteKit.SKNodes associated with bodyA and bodyB must be added to the SpriteKit.SKScene prior to calling this method or Sprite Kit will crash. The following example demonstrates the proper order:

C# Example

var node1 = CreateNodeSomehow();
var node2 = CreateNodeSomehow();
//var joint = SKPhysicsJointLimit.Create(node1.PhysicsBody, node2.PhysicsBody, node1.Position, node2.Position); //NO. This will crash.
mySkScene.AddChild(node1);
mkSkScene.AddChild(node2);
var joint SKPhysicsJointLimit.Create(node1.PhysicsBody, node2.PhysicsBody, node1.Position, node2.Position); //YES. Works fine.
mySkScene.PhysicsWorld.AddJoint(joint);            
              

(Other types of SpriteKit.SKPhysicsJoint can be created prior to the nodes being added to the scene-graph, although the nodes must be added to the scene-graph before SKPhysicsWorld.AddJoint is called.)

Requirements

Namespace: SpriteKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0