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

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:

主站蜘蛛池模板: 桃源县| 中西区| 子洲县| 封丘县| 澄迈县| 福海县| 安新县| 中牟县| 钟祥市| 上林县| 永兴县| 石家庄市| 安远县| 吉首市| 泰来县| 柳林县| 门源| 资讯 | 泰安市| 诸暨市| 吉林省| 宣化县| 吐鲁番市| 乌鲁木齐县| 黑水县| 将乐县| 峡江县| 香港 | 韶关市| 西乌| 台北市| 香格里拉县| 清新县| 榆树市| 会同县| 尼木县| 阜新市| 观塘区| 承德县| 永安市| 沙洋县|