官术网_书友最值得收藏!

Message label

Add a Label node to the scene and change its name to MessageLabel. This label will display the game's title, as well as Game Over when the game ends. This label should be centered on the game screen. You could drag it with the mouse, but to place UI elements precisely, you should use the Anchor properties.

Select View | Show Helpers to display pins that will help you see the anchor positions, then click on the Layout menu and select HCenter Wide:

The MessageLabel now spans the width of the screen and is centered vertically. The Text property in the Inspector sets what text the label displays. Set it to Coin Dash! and set Align and Valign to Center.

The default font for Label nodes is very small, so the next step is to assign a custom font. Scroll down to the Custom Fonts section in the Inspector and select New DynamicFont, as shown in the following screenshot:

Now, click on DynamicFont and you can adjust the font settings. From the FileSystem dock, drag the Kenney Bold.ttf font and drop it in the Font Data property. Set Size to 48, as shown in the following screenshot:

主站蜘蛛池模板: 竹山县| 合江县| 陇西县| 普洱| 绥化市| 喀喇沁旗| 广元市| 平塘县| 合肥市| 孝昌县| 南投市| 左贡县| 普宁市| 乌什县| 河池市| 昭觉县| 旺苍县| 淮南市| 仁化县| 光山县| 阿勒泰市| 河池市| 怀远县| 宜黄县| 定边县| 东至县| 巴青县| 洪江市| 高台县| 滕州市| 子长县| 北流市| 莒南县| 英超| 夏津县| 舒兰市| 黄龙县| 察雅县| 商都县| 无为县| 门头沟区|