From 0e38c6e15402e475950e60397476e380af810289 Mon Sep 17 00:00:00 2001 From: Jonas Bernard Date: Sat, 24 Apr 2021 22:58:54 +0200 Subject: Press button --- ..._press.png-fbfe3cd763891d3881d91d9c596cbad7.md5 | 3 ++ ...press.png-fbfe3cd763891d3881d91d9c596cbad7.stex | Bin 0 -> 144 bytes ..._press.png-a67baac8cbd9558a196be8df41561116.md5 | 3 ++ ...press.png-a67baac8cbd9558a196be8df41561116.stex | Bin 0 -> 144 bytes ..._press.png-b0866bf618dd9a0a88de66ce3ad4df18.md5 | 3 ++ ...press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex | Bin 0 -> 150 bytes components/button.gd | 5 +++ textures/components/button/left_press.png | Bin 0 -> 589 bytes textures/components/button/left_press.png.import | 34 +++++++++++++++++++++ textures/components/button/left_press.xcf | Bin 0 -> 845 bytes textures/components/button/middle_press.png | Bin 0 -> 584 bytes textures/components/button/middle_press.png.import | 34 +++++++++++++++++++++ textures/components/button/middle_press.xcf | Bin 0 -> 701 bytes textures/components/button/right_press.png | Bin 0 -> 588 bytes textures/components/button/right_press.png.import | 34 +++++++++++++++++++++ textures/components/button/right_press.xcf | Bin 0 -> 845 bytes 16 files changed, 116 insertions(+) create mode 100644 .import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.md5 create mode 100644 .import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex create mode 100644 .import/middle_press.png-a67baac8cbd9558a196be8df41561116.md5 create mode 100644 .import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex create mode 100644 .import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.md5 create mode 100644 .import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex create mode 100644 textures/components/button/left_press.png create mode 100644 textures/components/button/left_press.png.import create mode 100644 textures/components/button/left_press.xcf create mode 100644 textures/components/button/middle_press.png create mode 100644 textures/components/button/middle_press.png.import create mode 100644 textures/components/button/middle_press.xcf create mode 100644 textures/components/button/right_press.png create mode 100644 textures/components/button/right_press.png.import create mode 100644 textures/components/button/right_press.xcf 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 Binary files /dev/null and b/.import/left_press.png-fbfe3cd763891d3881d91d9c596cbad7.stex 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 Binary files /dev/null and b/.import/middle_press.png-a67baac8cbd9558a196be8df41561116.stex 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 Binary files /dev/null and b/.import/right_press.png-b0866bf618dd9a0a88de66ce3ad4df18.stex 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 Binary files /dev/null and b/textures/components/button/left_press.png 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 Binary files /dev/null and b/textures/components/button/left_press.xcf differ diff --git a/textures/components/button/middle_press.png b/textures/components/button/middle_press.png new file mode 100644 index 0000000..1ddbd8f Binary files /dev/null and b/textures/components/button/middle_press.png 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 Binary files /dev/null and b/textures/components/button/middle_press.xcf differ diff --git a/textures/components/button/right_press.png b/textures/components/button/right_press.png new file mode 100644 index 0000000..b4ab168 Binary files /dev/null and b/textures/components/button/right_press.png 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 Binary files /dev/null and b/textures/components/button/right_press.xcf differ -- cgit