Game Development Reference
In-Depth Information
Figure 14-24
.
Instantiate an iPV0 PropV object, add it to the root Scene Graph, and add it to a CurrentCast List<Act-
or>
Finally, let's add a
PropB
object into the scene, so that I can show you how your
tileable image can be flipped (mirrored) around
both
the X and the Y axes at the same
time. We'll follow our naming convention, naming the PropB object iPB0. The instan-
tiation statement, which can be seen in
Figure 14-25
, should look like the following
Java code:
iPB0
=
new PropB
("M150 0 L75 200 L225 200 Z", 0, 0,
iP0
);
Figure 14-25
.
Instantiate an iPB0 PropB object, add it to the root Scene Graph, and add it to a CurrentCast List<Act-
or>
Next, let's add the ImageView
Node
for the iPB0 PropB object into the Scene
Graph
root
object. This is done using a
.getChildren().add()
method chain. This refer-
ences a
spriteFrame
ImageView object, which is inside of the
iPB0
PropB object, us-
ing dot notation. This is done using the following Java statement, which is also shown
in
Figure 14-25
:
root
.getChildren().add(
iPB0.spriteFrame
);
Finally, we'll use the
.addCurrentCast()
method that we created in
Chapter 10
to
add this
iPB0
PropB object to a
CURRENT_CAST
List<Actor> ArrayList<Actor>