Skip to content

Commit

Permalink
Add UI theme
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanLovato committed Sep 28, 2019
1 parent 499c4f6 commit d85e0b5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 10 deletions.
13 changes: 13 additions & 0 deletions game/assets/theme/button_normal.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_resource type="StyleBoxFlat" format=2]

[resource]
bg_color = Color( 0.890196, 0.411765, 0.337255, 1 )
border_width_left = 6
border_width_top = 6
border_width_right = 6
border_width_bottom = 6
border_color = Color( 1, 0.709804, 0.439216, 1 )
corner_radius_top_left = 16
corner_radius_top_right = 16
corner_radius_bottom_right = 16
corner_radius_bottom_left = 16
13 changes: 13 additions & 0 deletions game/assets/theme/button_pressed.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_resource type="StyleBoxFlat" format=2]

[resource]
bg_color = Color( 0.631373, 0.247059, 0.188235, 1 )
border_width_left = 6
border_width_top = 6
border_width_right = 6
border_width_bottom = 6
border_color = Color( 0.890196, 0.411765, 0.337255, 1 )
corner_radius_top_left = 16
corner_radius_top_right = 16
corner_radius_bottom_right = 16
corner_radius_bottom_left = 16
11 changes: 7 additions & 4 deletions game/assets/ui_theme.tres
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[gd_resource type="Theme" load_steps=2 format=2]
[gd_resource type="Theme" load_steps=4 format=2]

[ext_resource path="res://assets/font_default.tres" type="DynamicFont" id=1]
[ext_resource path="res://assets/theme/button_normal.tres" type="StyleBox" id=2]
[ext_resource path="res://assets/theme/button_pressed.tres" type="StyleBox" id=3]

[resource]
default_font = ExtResource( 1 )
Expand All @@ -12,6 +14,7 @@ Button/constants/hseparation = 2
Button/fonts/font = ExtResource( 1 )
Button/styles/disabled = null
Button/styles/focus = null
Button/styles/hover = null
Button/styles/normal = null
Button/styles/pressed = null
Button/styles/hover = ExtResource( 2 )
Button/styles/normal = ExtResource( 2 )
Button/styles/pressed = ExtResource( 3 )
VBoxContainer/constants/separation = 8
12 changes: 6 additions & 6 deletions game/src/Screens/MainScreen.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[ext_resource path="res://assets/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://assets/background.png" type="Texture" id=2]
[ext_resource path="res://src/UserInterface/QuitButton.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/UserInterface/Title.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/UserInterface/SceneChangeButton.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/UserInterface/Title.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/UserInterface/QuitButton.tscn" type="PackedScene" id=5]

[node name="MainScreen" type="Control"]
anchor_right = 1.0
Expand All @@ -18,7 +18,7 @@ texture = ExtResource( 2 )
expand = true
stretch_mode = 2

[node name="Title" parent="." instance=ExtResource( 5 )]
[node name="Title" parent="." instance=ExtResource( 3 )]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
Expand All @@ -44,11 +44,11 @@ __meta__ = {

[node name="PlayButton" parent="Menu" instance=ExtResource( 4 )]
margin_right = 360.0
margin_bottom = 75.0
margin_bottom = 73.0
text = "Play"
next_scene_path = "res://src/Levels/Level01.tscn"

[node name="QuitButton" parent="Menu" instance=ExtResource( 3 )]
margin_top = 79.0
[node name="QuitButton" parent="Menu" instance=ExtResource( 5 )]
margin_top = 81.0
margin_right = 360.0
margin_bottom = 154.0

0 comments on commit d85e0b5

Please sign in to comment.