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

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:

主站蜘蛛池模板: 贺兰县| 新竹县| 奇台县| 乌鲁木齐市| 祥云县| 庄浪县| 沾益县| 衢州市| 肥乡县| 竹北市| 资兴市| 包头市| 郧西县| 阜城县| 都江堰市| 都昌县| 郧西县| 门头沟区| 茶陵县| 永德县| 德庆县| 察隅县| 玉山县| 云南省| 孟村| 定日县| 福贡县| 瑞金市| 克东县| 寻乌县| 嘉义县| 长兴县| 钦州市| 庆元县| 赫章县| 合阳县| 马鞍山市| 丽江市| 日土县| 辛集市| 衡山县|