Game Development Reference
In-Depth Information
Setting Alpha to 0 will make the actor transparent but the display text will remain
visible. This is how you achieve the best result.
In order to perfectly position the score display on the scene, use a Change
Attribute behavior to constrain its position. Drag and drop a Change Attribute
behavior into the behavior area of the P1 Score actor. Then select the P1
Score.Position.X attribute and change it to 215. Once selected, it will display as
self.Position.X. Repeat the operation with P1 Score.Position.Y with a change
to 295.
Last but not least, drag a Display Text behavior. The Display Text behavior is
shown in Figure 3-5.
Figure 3-5. The Display Text behavior
In the Display Text behavior box, you can either enter your own text or access
the Expression Editor. You have several options to format your text, such as
choosing the alignment, the font, the size, and the color. The ''Wrap inside
actor'' option creates line breaks so that your text fits inside the actor.
In the Display Text behavior box that you just dropped, open the Expression
Editor and select the following attribute: game.P1 Score. Set the size as 20 and
choose an orange color so it is clearly visible on the scene.
Figure 3-6 shows the final result.
Search WWH ::




Custom Search