In this section, I will show you how to design UI for games instead of using other UIs on the net. I will show you how to use it directly in Godot.
| Join the channel Telegram of the AnonyViet 👉 Link 👈 |
Styles
For versions from 3.3 and below, it is called Custom Styles in the Inspector box of a certain node in the Control node.
And in Godot version 3.4 and above, it is located in Theme Overrides -> Styles.
And of course the design of these Control nodes will have two ways:
+ One is that you will use Theme and when you use Theme you adjust at the root node, the child nodes will also be adjusted.
+ Second, you will adjust the own styles of node.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 30 [Tạo 2D Platformer Game với Godot] Part 17: Designing UI with Custom Styles](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-12-53-56.png)
Here, I will choose the NutBatDau node to design.![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 31 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 27](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-12-54-10.png)
In the Inspector panel of the NutBatDau node, select Theme Overrides -> Styles.
You will see 5 lines:
- Hover: The style of the node when the mouse hovers over the node.
- Pressed: style when node is clicked.
- Focus: similar to pressed but when it’s focused
- Disabled: style when you are disabling this node.
- Normal: style in the normal state doing nothing.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 32 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 28](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-00-19.png)
I will design Normal fish first.
You click [empty] -> New StyleBoxFlat
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 34 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 30](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-01-12.png)
You will then see the Button has turned gray and a new line tab appears below Normal.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 37 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 33](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-04-02.png)
I will change the Bg Color to green and the Color id here I have is 41d822.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 38 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 34](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-04-53.png)
Next I will go to Conner Radius to adjust the corner radius.
If you adjust it to high, the corner will be rounded again.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 39 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 35](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-05-57.png)
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 40 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 36](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-06-11.png)
This is after I set the Corner Radius to 8.
But the Button is quite small and the text is close to the node, so it is not very beautiful.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 41 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 37](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-07-06.png)
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 42 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 38](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-07-13.png)
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 43 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 39](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-07-34.png)
Therefore, I will go through the rect part and adjust it to a reasonable min size.
Remember to adjust at min size, not in size, if you adjust in size when running the game it will still reset to the old size.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 45 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 41](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-11-15.png)
Next, I will add the outside details = how to apply Blend at the Border and adjust the color to make it reasonable. Here my color is: 385831.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 46 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 42](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-12-09.png)
After adjusting the Border, go to Border width and adjust it from 1 to 3 so that it will appear border.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 47 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 43](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-13-31.png)
Then I add a little shadow.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 50 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 46](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-14-40.png)
Next I will do it with pressed but instead of having to start over, I will copy and paste it.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 51 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 47](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-15-36.png)
Then click on the arrow in pressed and choose make unique.
If you do not press make unique, when you edit Styles in Normal, Pressed will also be changed.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 52 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 48](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-17-11.png)
I will adjust the bg color of pressed a little brighter so that users know that they have already pressed it.
My color: 34fc0b.
![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 53 [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles 49](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-18-27.png)
Next, you do the same with Hover.![[Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles [Tạo 2D Platformer Game với Godot] Part 19: Designing UI with Custom Styles](https://anonyviet.com/wp-content/uploads/2021/11/20-11-2021-01-20-13.png)
I will have the final result.
summary
So I showed you how to design UI with Godot and in the next part I will show you how to create custom fonts.










