summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernard <public.jbernard@web.de>2021-04-24 22:58:54 +0200
committerJonas Bernard <public.jbernard@web.de>2021-04-24 22:58:54 +0200
commit0e38c6e15402e475950e60397476e380af810289 (patch)
tree1013f6f0be135e837d317787dc2fc5f5f2993b05
parent945c4166bae70399eb9060ce4b5e2de0b44f70ce (diff)
downloadldjam48-0e38c6e15402e475950e60397476e380af810289.tar.gz
ldjam48-0e38c6e15402e475950e60397476e380af810289.tar.bz2
ldjam48-0e38c6e15402e475950e60397476e380af810289.zip
Press button
-rw-r--r--.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.md53
-rw-r--r--.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stexbin0 -> 144 bytes
-rw-r--r--.import/middle_press.png-a67baac8cbd9558a196be8df41561116.md53
-rw-r--r--.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stexbin0 -> 144 bytes
-rw-r--r--.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.md53
-rw-r--r--.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stexbin0 -> 150 bytes
-rw-r--r--components/button.gd5
-rw-r--r--textures/components/button/left_press.pngbin0 -> 589 bytes
-rw-r--r--textures/components/button/left_press.png.import34
-rw-r--r--textures/components/button/left_press.xcfbin0 -> 845 bytes
-rw-r--r--textures/components/button/middle_press.pngbin0 -> 584 bytes
-rw-r--r--textures/components/button/middle_press.png.import34
-rw-r--r--textures/components/button/middle_press.xcfbin0 -> 701 bytes
-rw-r--r--textures/components/button/right_press.pngbin0 -> 588 bytes
-rw-r--r--textures/components/button/right_press.png.import34
-rw-r--r--textures/components/button/right_press.xcfbin0 -> 845 bytes
16 files changed, 116 insertions, 0 deletions
diff --git a/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.md5 b/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.md5
new file mode 100644
index 0000000..b88cdb8
--- /dev/null
+++ b/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.md5
@@ -0,0 +1,3 @@
+source_md5="f0c2a86f102d9ec7ecaacaad2509b4fe"
+dest_md5="9c33a906b738b0e0641e146121168c9f"
+
diff --git a/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex b/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex
new file mode 100644
index 0000000..b98dccc
--- /dev/null
+++ b/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex
Binary files differ
diff --git a/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.md5 b/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.md5
new file mode 100644
index 0000000..3ee23b5
--- /dev/null
+++ b/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.md5
@@ -0,0 +1,3 @@
+source_md5="b1ba272800971236e5c2ef54bf197965"
+dest_md5="9e8fd1841dc550b93bc8489d976af760"
+
diff --git a/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex b/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex
new file mode 100644
index 0000000..6d13da9
--- /dev/null
+++ b/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex
Binary files differ
diff --git a/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.md5 b/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.md5
new file mode 100644
index 0000000..b457d51
--- /dev/null
+++ b/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.md5
@@ -0,0 +1,3 @@
+source_md5="5ae3515b30f314a7fc4991903010a007"
+dest_md5="5525ae87b52871e3e4c55297d0db0ef6"
+
diff --git a/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex b/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex
new file mode 100644
index 0000000..f0e4ee4
--- /dev/null
+++ b/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex
Binary files differ
diff --git a/components/button.gd b/components/button.gd
index b6753fe..5e90ecc 100644
--- a/components/button.gd
+++ b/components/button.gd
@@ -22,10 +22,13 @@ const BASE_HEIGHT = 16
const left_nohover = preload("res://textures/components/button/left.png")
const left_hover = preload("res://textures/components/button/left_hover.png")
+const left_press = preload("res://textures/components/button/left_press.png")
const middle_nohover = preload("res://textures/components/button/middle.png")
const middle_hover = preload("res://textures/components/button/middle_hover.png")
+const middle_press = preload("res://textures/components/button/middle_press.png")
const right_nohover = preload("res://textures/components/button/right.png")
const right_hover = preload("res://textures/components/button/right_hover.png")
+const right_press = preload("res://textures/components/button/right_press.png")
func _ready():
var label = Label.new()
@@ -47,7 +50,9 @@ func _on_ButtonTest_input_event(viewport, event, shape_idx):
if not (event is InputEventMouseButton):
return
if not event.pressed:
+ _set_all_textures(left_hover, middle_hover, right_hover)
return
+ _set_all_textures(left_press, middle_press, right_press)
emit_signal("on_click")
func _set_all_textures(l, m, r):
diff --git a/textures/components/button/left_press.png b/textures/components/button/left_press.png
new file mode 100644
index 0000000..2aa29bf
--- /dev/null
+++ b/textures/components/button/left_press.png
Binary files differ
diff --git a/textures/components/button/left_press.png.import b/textures/components/button/left_press.png.import
new file mode 100644
index 0000000..77d863d
--- /dev/null
+++ b/textures/components/button/left_press.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://textures/components/button/left_press.png"
+dest_files=[ "res://.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/textures/components/button/left_press.xcf b/textures/components/button/left_press.xcf
new file mode 100644
index 0000000..f99884d
--- /dev/null
+++ b/textures/components/button/left_press.xcf
Binary files differ
diff --git a/textures/components/button/middle_press.png b/textures/components/button/middle_press.png
new file mode 100644
index 0000000..1ddbd8f
--- /dev/null
+++ b/textures/components/button/middle_press.png
Binary files differ
diff --git a/textures/components/button/middle_press.png.import b/textures/components/button/middle_press.png.import
new file mode 100644
index 0000000..f352abf
--- /dev/null
+++ b/textures/components/button/middle_press.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://textures/components/button/middle_press.png"
+dest_files=[ "res://.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/textures/components/button/middle_press.xcf b/textures/components/button/middle_press.xcf
new file mode 100644
index 0000000..b95c48a
--- /dev/null
+++ b/textures/components/button/middle_press.xcf
Binary files differ
diff --git a/textures/components/button/right_press.png b/textures/components/button/right_press.png
new file mode 100644
index 0000000..b4ab168
--- /dev/null
+++ b/textures/components/button/right_press.png
Binary files differ
diff --git a/textures/components/button/right_press.png.import b/textures/components/button/right_press.png.import
new file mode 100644
index 0000000..297a8c8
--- /dev/null
+++ b/textures/components/button/right_press.png.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://textures/components/button/right_press.png"
+dest_files=[ "res://.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=false
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/textures/components/button/right_press.xcf b/textures/components/button/right_press.xcf
new file mode 100644
index 0000000..6e439e3
--- /dev/null
+++ b/textures/components/button/right_press.xcf
Binary files differ