Game Development Reference
In-Depth Information
Reviewing the Node Library
On the Resource Navigator pane (left side), click on the Node Library View tab. This
brings up a list of items that can be dragged and dropped onto the stage. Most of these
items are nodes, inheriting from Cocos2d's base class CCNode. The only other types of
items are joints used by the physics engine. In Figure 2-5 , you'll find the full list of nodes
available at the time of this writing.
Figure 2-5 . List of available nodes in SpriteBuilder
I'll quickly go over the various node types and their purpose
Node: An invisible node that is used to group (or “layer”) other nodes. Ima-
gine them being folders that contain related items. This affects draw order,
and it can be useful to access related items easier in code, or just to sort,
move, or collapse nodes in the SpriteBuilder timeline.
Sub File: A placeholder for embedding another CCB file. This is a very
powerful node because it allows you to use other CCB files like templates
and to create and edit a single CCB that is used (instantiated) multiple times.
Dragging a CCB file onto a stage will automatically create a Sub File node.
Physics Node: This represents the physics world. Any node with physics en-
abled has to be a child or grandchild of a Physics Node, or it won't have
physics enabled after all. Generally, only one Physics Node should be used
per scene. Multiple worlds are possible, but their children will not be able to
interact with each other.
Search WWH ::




Custom Search