Game Development Reference
In-Depth Information
As it has so many times before, a grouping node will come in handy for both positioning
and animation. Add a regular
Node
from the Node Library View onto the stage. Change
the node's position types to
%
and its values to
50
. Give the node a nice name, let's say
lo-
goAndButtons
. I bet you can do these steps in your sleep after just a few days of working
with SpriteBuilder.
From the Tileless Editor View, you can now drag and drop the
play
,
settings
, and
title
im-
ages onto the
logoAndButtons
node. The actual position for these sprites are not really im-
portant, but I'll give you the values I used.
The title sprite should be slightly above center, so change its position to
0, 50
. The play
sprite's position should be at
-50, -60
, and the settings sprite's position at
50, -60
. Negat-
ive positions are absolutely okay since the position of a node is always relative to the par-
ent nodeāin this case,
logoAndButtons
. The three sprites should now have some space
between them, as you can see in
Figure 7-5
.
Figure 7-5
.
The MainMenuButtons.ccb contents
Tip
If you need to see the background to properly align buttons and logos, you
can always drag and drop
MainMenuBackground.ccb
onto the stage and move
it to the top of the Timeline so that it is drawn in the background. However, you
should not forget to remove that background layer or at least uncheck its
Visible
property. Merely unchecking the eye symbol will only hide it from SpriteBuild-
er, but it will still render two instances of
MainMenuBackground.ccb
. That
would be a major drag on performance.
Search WWH ::
Custom Search