fix: preserve circus sign silhouette and ropes

This commit is contained in:
enne2
2026-09-08 11:48:24 +02:00
parent 3e5fd25f85
commit 7af475aec0
6 changed files with 112 additions and 14 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cbp7fcsgcud4u"
path="res://.godot/imported/upendi_circus_sign_panel.png-fb1ab388766e4b8103b06357951ad4d1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://menus/assets/p1/upendi_circus_sign_panel.png"
dest_files=["res://.godot/imported/upendi_circus_sign_panel.png-fb1ab388766e4b8103b06357951ad4d1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cc5el5lnpxldi"
path="res://.godot/imported/upendi_circus_sign_ropes.png-ac90efc2477b7d052aec26561e0cad89.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://menus/assets/p1/upendi_circus_sign_ropes.png"
dest_files=["res://.godot/imported/upendi_circus_sign_ropes.png-ac90efc2477b7d052aec26561e0cad89.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+1 -1
View File
@@ -109,7 +109,7 @@ func _bind_screen(screen: Control) -> void:
screen.juggle_requested.connect(func(focal: Control): _navigate(JUGGLE_SCENE, "p2a", focal))
screen.gym_requested.connect(func(focal: Control): _navigate(GYM_SCENE, "p3a", focal))
screen.sign_drop_started.connect(menu_audio.play_sign_drop)
screen.sign_bounced.connect(menu_audio.play_sign_bounce)
screen.sign_landed.connect(menu_audio.play_sign_bounce)
screen.exit_requested.connect(func():
menu_audio.play_tone(220.0)
exit_requested.emit()
+31 -13
View File
@@ -6,6 +6,7 @@ signal juggle_requested(focal: Control)
signal gym_requested(focal: Control)
signal exit_requested
signal sign_drop_started
signal sign_landed
signal sign_bounced
const HOME_BG := preload("res://menus/assets/common/1_sfondo.png")
@@ -14,7 +15,8 @@ const BLUE_TENT := preload("res://menus/assets/p1/1_tendone_1.png")
const RED_TENT := preload("res://menus/assets/p1/1_tendone_2.png")
const BACK_BUTTON := preload("res://menus/assets/common/pulsante_indietro.png")
const SETTINGS_BUTTON := preload("res://menus/assets/common/pulsante_rotellina.png")
const CIRCUS_SIGN := preload("res://menus/assets/p1/upendi_circus_sign_static.png")
const CIRCUS_SIGN_PANEL := preload("res://menus/assets/p1/upendi_circus_sign_panel.png")
const CIRCUS_SIGN_ROPES := preload("res://menus/assets/p1/upendi_circus_sign_ropes.png")
func _ready() -> void:
@@ -69,26 +71,42 @@ func _add_bottom_bar() -> void:
func _add_sign() -> void:
var sign := TextureRect.new()
sign.texture = CIRCUS_SIGN
sign.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
sign.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
sign.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(sign)
MenuUI.set_normalized_rect(sign, Vector2(0.50, 0.17), Vector2(0.43, 0.34))
# Il pannello si muove, mentre le funi restano ancorate al bordo superiore.
# Separare i due livelli conserva la texture disegnata originale senza lasciare
# un vuoto quando il pannello supera verso il basso il punto di riposo.
var rig := Control.new()
rig.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(rig)
MenuUI.set_normalized_rect(rig, Vector2(0.50, 0.17), Vector2(0.43, 0.34))
_add_sign_layer(rig, CIRCUS_SIGN_ROPES)
var panel := _add_sign_layer(rig, CIRCUS_SIGN_PANEL)
var final_y := panel.position.y
panel.position.y = final_y - panel.size.y * 1.15
var final_y := sign.position.y
sign.position.y = final_y - sign.size.y * 1.15
var tween := create_tween()
# Il menu viene messo in pausa dalla shell: l'ingresso deve continuare comunque.
tween.set_pause_mode(Tween.TWEEN_PAUSE_PROCESS)
# Discesa rapida, breve superamento del punto d'arrivo e rimbalzo elastico.
# Discesa rapida, atterraggio evidente e rimbalzo elastico.
call_deferred("_emit_sign_drop_started")
tween.tween_property(sign, "position:y", final_y + sign.size.y * 0.04, 1.10).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
tween.tween_property(sign, "position:y", final_y, 0.50).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT)
tween.tween_property(panel, "position:y", final_y + panel.size.y * 0.11, 1.10).set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
# L'impatto è sincronizzato con la massima estensione, prima del ritorno elastico.
tween.tween_callback(func(): sign_landed.emit())
tween.tween_property(panel, "position:y", final_y, 0.50).set_trans(Tween.TRANS_BOUNCE).set_ease(Tween.EASE_OUT)
tween.tween_callback(func(): sign_bounced.emit())
func _add_sign_layer(parent: Control, texture: Texture2D) -> TextureRect:
var layer := TextureRect.new()
layer.texture = texture
layer.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
layer.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
layer.mouse_filter = Control.MOUSE_FILTER_IGNORE
parent.add_child(layer)
layer.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
return layer
func _emit_sign_drop_started() -> void:
if is_inside_tree():
sign_drop_started.emit()