Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Tried to make the mute and back buttons less intrusive
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Jan 29, 2021
1 parent 3095637 commit 9af03b3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
16 changes: 10 additions & 6 deletions HUD.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]

[ext_resource path="res://HUD.gd" type="Script" id=1]
[ext_resource path="res://assets/fonts/monogram.tres" type="DynamicFont" id=2]
[ext_resource path="res://assets/ui/close.png" type="Texture" id=3]
[ext_resource path="res://assets/ui/mute.png" type="Texture" id=4]
[ext_resource path="res://ui/TransparentButton.gd" type="Script" id=5]

[node name="HUD" type="CanvasLayer"]
script = ExtResource( 1 )
Expand All @@ -21,27 +22,30 @@ align = 1
visible = false
anchor_left = 1.0
anchor_right = 1.0
margin_left = -44.0
margin_left = -30.0
margin_top = 2.0
margin_right = -2.0
margin_bottom = 38.0
margin_bottom = 30.0
focus_mode = 0
custom_fonts/font = ExtResource( 2 )
enabled_focus_mode = 0
icon = ExtResource( 3 )
clip_text = true
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="MuteButton" type="Button" parent="."]
margin_left = 2.0
margin_top = 2.0
margin_right = 44.0
margin_bottom = 38.0
margin_right = 30.0
margin_bottom = 30.0
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
icon = ExtResource( 4 )
clip_text = true
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
Expand Down
Binary file modified assets/ui/close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/ui/mute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions ui/TransparentButton.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends Button

onready var original_modulate = modulate

export (float) var transparency := 0.75

func _ready() -> void:
self.connect("mouse_entered", self, "_on_mouse_entered")
self.connect("mouse_exited", self, "_on_mouse_exited")
_on_mouse_exited()

func _on_mouse_entered() -> void:
modulate = original_modulate

func _on_mouse_exited() -> void:
modulate.a = transparency

0 comments on commit 9af03b3

Please sign in to comment.