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

Containers

UI containers automatically arrange the positions of their child Control nodes (including other Containers). You can use them to add padding around elements, center them, or arrange elements in rows or columns. Each type of Container has special properties that control how they arrange their children. You can see these properties in the Custom Constants section of the Inspector.

Remember that containers automatically arrange their children. If you move or resize a Control that's inside a Container node, you'll find it snaps back to its original position. You can manually arrange controls or arrange them with a container, but not both.

To manage the score and time labels, add a MarginContainer node to the HUD. Use the Layout menu to set the anchors to Top Wide. In the Custom Constants section, set Margin Right, Margin Top, and Margin Left to 10. This will add some padding so that the text isn't against the edge of the screen.

Since the score and time labels will use the same font settings as the MessageLabel, it will save time if you duplicate it. Click on MessageLabel and press Ctrl + D (Cmd + D on macOS) twice to create two duplicate labels. Drag them both and drop them on the MarginContainer to make them its children. Name one ScoreLabel and the other TimeLabel and set the Text property to 0 for both. Set Align to Left for ScoreLabel and Right for TimeLabel.

主站蜘蛛池模板: 金湖县| 徐汇区| 枣阳市| 桃江县| 南阳市| 南溪县| 和林格尔县| 盘锦市| 鄯善县| 始兴县| 道真| 保靖县| 同心县| 静宁县| 焉耆| 柳江县| 三门峡市| 克山县| 长海县| 营山县| 乡宁县| 达尔| 崇阳县| 类乌齐县| 隆尧县| 托克托县| 龙井市| 柳江县| 七台河市| 嫩江县| 唐海县| 宜兰市| 旬阳县| 黎平县| 仁化县| 定兴县| 聂拉木县| 晋江市| 阿鲁科尔沁旗| 汤阴县| 哈巴河县|