Code a Score Display in GameMaker: Studio
By writing code to create the score display on your game in GameMaker: Studio, you can customize it to your liking, without necessarily having to use images. With that said, the following example uses the ScoreBox image, which you can find in the Graphics folder of the assets for the in-software coding tutorial.
Choose Resources→Create Sprite.
The Sprite Properties window appears.
In the name field, type something like spr_scorebox.
Choose Load Sprite.
A navigation window opens.
Navigate to thescorebox.png on your PC, or whichever image you want to use.
Select the image file and choose Open from the navigation window.
A thumbnail of the image appears in the Sprite Properties window.
For the Origin, click Center (see the figure).
GameMaker determines the center of the image — in this case, X becomes 48 and Y becomes 16 (refer to the figure). This will help you align the text for the score and lives later on.The Sprite Properties window.
The Sprite Properties window is saved and closed.
You just created a Sprite that you can use as part of your score display.