Importing the font

Before we can render the score for our game to the HUD layer of our game, we need to import the appropriate font, otherwise Stencyl would use the default font, which would look pretty drab and boring. To import and configure the font, we need to follow these steps:

  1. In the Dashboard tab, under RESOURCES, go to Fonts, and click on Create New.
  2. Name your new font Western Font, and click on Create.
  3. Under Font Style, click on Choose, as shown in the following screenshot:
    Importing the font
  4. A file browser will appear. Navigate to and select Game Assets/Fonts/GRINGONIGHTS.ttf.
  5. Set Size to 30, as shown in the previous screenshot.
  6. Click on the Color tab, then on the Color swatch, and set it to Light Orange, as shown in the following screenshot:
    Importing the font
  7. Next, switch to the Effects tab, and under the Stroke tab, change Color to black, then set Size to 1, as shown in the following screenshot:
    Importing the font

Excellent! Our font is imported and ready for use. The next thing we need to do is create the logic that will detect collisions between the Player Character and the coins, delete the Coin actor and increment the score, and ultimately render it to the screen using the font we just imported.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.140.204