From 8bcba716764ba2ebee433fad816f922e44f892bd Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 14 Feb 2022 00:46:40 +0000 Subject: Improve popup appearance. --- fonts/font_regular.tres | 2 +- logic/popup_list.gd | 5 ++++- main.tscn | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/fonts/font_regular.tres b/fonts/font_regular.tres index 01b4567..d42e75b 100644 --- a/fonts/font_regular.tres +++ b/fonts/font_regular.tres @@ -3,6 +3,6 @@ [ext_resource path="res://fonts/B612Mono-Regular.ttf" type="DynamicFontData" id=1] [resource] -size = 32 +size = 42 use_filter = true font_data = ExtResource( 1 ) diff --git a/logic/popup_list.gd b/logic/popup_list.gd index 1dd156c..43bf2a1 100644 --- a/logic/popup_list.gd +++ b/logic/popup_list.gd @@ -2,7 +2,8 @@ extends Popup signal item_selected -onready var item_list := get_node("list") as TouchItemList +onready var item_list := get_node("list") as TouchItemList +onready var blur := get_node("blur") as ColorRect func _ready(): @@ -15,6 +16,8 @@ func popup_options(options: Array): for it in options: item_list.add_item(it) self.popup_centered_ratio(0.9) + blur.rect_global_position = Vector2.ZERO + blur.rect_size = get_viewport_rect().size func selected(index: int): diff --git a/main.tscn b/main.tscn index 1169994..a378319 100644 --- a/main.tscn +++ b/main.tscn @@ -317,6 +317,12 @@ anchor_bottom = 1.0 popup_exclusive = true script = ExtResource( 10 ) +[node name="blur" type="ColorRect" parent="popup_list"] +show_behind_parent = true +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 0.75 ) + [node name="list" parent="popup_list" instance=ExtResource( 11 )] margin_top = 0.0 -- cgit v1.2.3