generated from krampus/template-godot4
Workaround for clipping rectangle rotation issue by simply hiding things that shouldn't be shown
This commit is contained in:
parent
05edbf5d27
commit
41814c2c4a
@ -229,6 +229,7 @@ text = ""
|
|||||||
[node name="RetroSelectorList" parent="." instance=ExtResource("3_n8ehr")]
|
[node name="RetroSelectorList" parent="." instance=ExtResource("3_n8ehr")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
offset_bottom = 11.0
|
offset_bottom = 11.0
|
||||||
|
options = Array[String](["aaa", "bbb", "ccc", "defghijk"])
|
||||||
|
|
||||||
[node name="TransitionPlayer" type="AnimationPlayer" parent="."]
|
[node name="TransitionPlayer" type="AnimationPlayer" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
@ -32,6 +32,19 @@ func _ready() -> void:
|
|||||||
rebuild_list()
|
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:
|
func rebuild_list() -> void:
|
||||||
# Remove any existing items
|
# Remove any existing items
|
||||||
for c: Node in title_list.get_children():
|
for c: Node in title_list.get_children():
|
||||||
@ -69,6 +82,7 @@ func expand() -> Tween:
|
|||||||
. set_ease(Tween.EASE_OUT)
|
. set_ease(Tween.EASE_OUT)
|
||||||
)
|
)
|
||||||
_active_tween = tween
|
_active_tween = tween
|
||||||
|
_show_all()
|
||||||
selection_mask.show()
|
selection_mask.show()
|
||||||
return tween
|
return tween
|
||||||
|
|
||||||
@ -104,6 +118,7 @@ func contract() -> Tween:
|
|||||||
. set_trans(Tween.TRANS_CUBIC)
|
. set_trans(Tween.TRANS_CUBIC)
|
||||||
. set_ease(Tween.EASE_OUT)
|
. set_ease(Tween.EASE_OUT)
|
||||||
)
|
)
|
||||||
|
tween.chain().tween_callback(_hide_unselected)
|
||||||
return tween
|
return tween
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user