Game Development Reference
In-Depth Information
Timeline. Likewise, you can drag and drop joints like nodes, too. Unfortunately, at least at
the time of this writing, you can't copy and paste joints.
The two smaller circles underneath a joint, as shown in Figure 9-4 , indicate that the joint
hasn't been connected with other bodies.
You can click and drag on one of the two small circles to draw out a line. If you have
some experience with Interface Builder, you'll find this behavior is similar to connecting
IB outlets and actions. You can drag the line over a physics-enabled node onto the stage or
on the timeline, and when you release the mouse button the connection is made if the
highlighted drop target was a valid physics-enabled node. This makes a connection with
the physics body and the joint.
In this instance, drag from the left circle and drop the line onto the hook node. You may
find it easier to drop the line onto the hook node in the Timeline rather than trying to loc-
ate it on the stage as shown in Figure 9-4 . That's mainly because the hook is invisible and
has only a small collision shape.
Drag a line from the right circle below the joint onto the first chain element and then drop
the line. Again it may be easier to drop the line on the node in the Timeline. Once this is
done, the two smaller circles will be gone, indicating that this joint is properly connected
to two bodies.
Note Not connecting one or both joint connectors to physics bodies will gener-
ate a warning when publishing the SpriteBuilder project, indicating that the
joint will not be functional.
Editing Common Joint Properties
With the pivot joint still selected, go to the Item Properties tab. You'll see a host of new
properties.
Figure 9-5 shows the properties common to all joints, except for the Reference property
(which exists only on pivot joints), while the other joints have an additional Anchor B set-
ting. The pivot joint is the only joint with a single anchor point.
Search WWH ::




Custom Search