Workaround for clipping rectangle rotation issue by simply hiding things that shouldn't be shown

This commit is contained in:
Rob Kelly 2025-06-27 16:18:03 -06:00
parent 05edbf5d27
commit 41814c2c4a
2 changed files with 16 additions and 0 deletions

View File

@ -229,6 +229,7 @@ text = ""
[node name="RetroSelectorList" parent="." instance=ExtResource("3_n8ehr")]
unique_name_in_owner = true
offset_bottom = 11.0
options = Array[String](["aaa", "bbb", "ccc", "defghijk"])
[node name="TransitionPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true

View File

@ -32,6 +32,19 @@ func _ready() -> void:
rebuild_list()
## This is a workaround for an issue with the clipping boundary
func _hide_unselected() -> void:
for i: int in title_list.get_child_count():
if i != selection_idx:
(title_list.get_child(i) as CanvasItem).modulate = Color.TRANSPARENT
func _show_all() -> void:
for n: Node in title_list.get_children():
if n is CanvasItem:
(n as CanvasItem).modulate = Color.WHITE
func rebuild_list() -> void:
# Remove any existing items
for c: Node in title_list.get_children():
@ -69,6 +82,7 @@ func expand() -> Tween:
. set_ease(Tween.EASE_OUT)
)
_active_tween = tween
_show_all()
selection_mask.show()
return tween
@ -104,6 +118,7 @@ func contract() -> Tween:
. set_trans(Tween.TRANS_CUBIC)
. set_ease(Tween.EASE_OUT)
)
tween.chain().tween_callback(_hide_unselected)
return tween