Game Development Reference
In-Depth Information
Home
In order to perfectly position the background object, you will use the trick of
changing the position attributes.
Open the Home actor in the Actor Editor. Drag and drop a Change Attribute
behavior and change Home.Position.X to 384.
Drag and drop a Change Attribute behavior and change Home.Position.Y
to 512.
The two behaviors are shown in Figure 9-2.
Figure 9-2. Positioning the background with Change Attributes
Now drag and drop the actor on the scene and position it approximately in the
center.
Start Game
The Start Game actor will be used as a button. You will implement a rollover
effect so that the color of the font changes when the button is pressed. But,
because it is an image, you will use the Change Image behavior and use a
different image to replace the active one.
You will proceed in two steps. First, you will change the image to an image with
a different font color when the actor is pressed. Then you will change the image
back to the original when the actor touch is released. This is only one of the
many ways to createa button-pressing effect. Another approach could be to
change either alpha to 0.5 or RGB colors to 0.5.
Open the Start Game actor in the Actor Editor. Create a new rule and name it
''Touch is Pressed.'' The condition is ''Actor receives event'' ''touch'' is
''pressed.''
Then drag and drop a Change Image behavior into the rule and select ''play2''
from the drop-down next to ''Set Image to.''
 
Search WWH ::




Custom Search