Game Development Reference
In-Depth Information
Now let's spawn the logo. In the behaviors, find
Spawn Actor
and drag it into
the
Timer
.
I changed the vertical position to
10
, which would be 10 pixels above the chest.
Let's go to the logo actor. We can use the one in the
Inspector
panel because this is
probably the only time we are going to use this actor in the game.
Create a Timer behavior, and change its
After
text field to
1
second, then drag in
a
Move To
behavior. Click on the
e
beside the horizontal position. Click on the
down-arrow button to expand the editor. Select
Game
|
Display Size
, then
double-click on the
Width
.
It will now show up above in text as
game.displaySize.Width
. After that expression,
type in
/2 - 100
. This will place the actor in the middle of the screen, minus
100 pixels.
Do the same for the vertical position, but instead of
Width
, you'll choose
Height
;
then type in
/2
, to divide by 2.
Both expressions should be written out like this:
•
Horizontal
:
game.Display Size.Width /2 -100
•
Vertical
:
game.Display Size.Height /2