Game Development Reference
In-Depth Information
bnkc*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjBnkcHkkg%7
oap?deh`Ej`at$lh]uan(jqi?deh`naj)-%7
bkn$r]ne6ejp9,7e8jqi?deh`naj7e''%
w
pn]_a$e'*'cap?deh`=p$e%*j]ia%7
y
y
2. Save the I]ej[>qc?]p_dan*]o file and test the project. The cat will now be the last item on the
list in the Output panel. The cat now appears above the frog and the platforms on the stage.
One last thing in the stacking order that I want to fix is to make the cat appear behind the transpar-
ent water graphic so it looks like it's standing in water when it's on the ground. To do this, I'll give the
s]pan object a position index number of jqi?deh`naj)- and the lh]uan object a position number of
jqi?deh`naj)2.
1. Update the constructor method:
lq^he_bqj_pekjI]ej[>qc?]p_dan$%
w
]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjAjpanBn]ia%7
bnkc*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjBnkcHkkg%7
oap?deh`Ej`at$s]pan(jqi?deh`naj)-%7
oap?deh`Ej`at$lh]uan(jqi?deh`naj).%7
bkn$r]ne6ejp9,7e8jqi?deh`naj7e''%
w
pn]_a$e'*'cap?deh`=p$e%*j]ia%7
y
y
2. Save the I]ej[>qc?]p_dan*]o file and test the project. The cat now appears in front of all the
other objects, but behind the s]pan object, as shown in Figure 9-22.
Figure 9-22. The cat appears in front of the frog but behind the water.
The appearance of objects being in front of or behind other objects has nothing to do with which
layer they were created on in the FLA. Once their position on the display list is altered, that position
takes precedence over the layer position in the FLA. You can make an object from a bottom layer
appear above all other objects just by changing its position on the display list.
 
Search Nedrilad ::




Custom Search