From a56d826a10d052a3008ed5c1f187c650f18c1fef Mon Sep 17 00:00:00 2001 From: LoafyLemon Date: Tue, 21 May 2024 01:58:08 +0100 Subject: [PATCH] Improve text box and animate it --- game/gui/creamy_pumpkin_pie/namebox.png | 4 +- game/scripts/gui/say.rpy | 50 ++++++++++++++----------- game/scripts/options.rpy | 6 +-- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/game/gui/creamy_pumpkin_pie/namebox.png b/game/gui/creamy_pumpkin_pie/namebox.png index e0109a7d..95fd0eb6 100644 --- a/game/gui/creamy_pumpkin_pie/namebox.png +++ b/game/gui/creamy_pumpkin_pie/namebox.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37bac66bae95b84b3d156728df06bab78ff4b1dc32fd7c754ec3fc305750cf48 -size 1699 +oid sha256:17439008bbacb5ebee21791584a89936dfd7ae70c9b32b2c3268eef70df34a22 +size 1741 diff --git a/game/scripts/gui/say.rpy b/game/scripts/gui/say.rpy index cd18d4f2..71ab3901 100644 --- a/game/scripts/gui/say.rpy +++ b/game/scripts/gui/say.rpy @@ -20,10 +20,7 @@ screen say(who, what, side_image=None, icon=None): id "textbox" style "textbox" - # TODO: Remove after 1080p gets implemented - at transform: - zoom 0.5 - xalign 0.5 + at gui_show_hide # Ren'py hard crashes without textbox windows, # this is the workaround that just works. @@ -82,46 +79,46 @@ style quickbox_button_text: color "#bbbbbb" hover_color "#ffffff" selected_color "#EA8E61" - outlines [(3, "#000000", 1, 1)] - size 36 + outlines [(2, "#000000", 1, 1)] + size 24 style textbox: - ysize 250 - yalign 1.0 - background Transform(Image("gui/creamy_pumpkin_pie/textbox.png", xalign=0.5, yalign=1.0, oversample=2), alpha=0.5) + ysize 125 + align (0.5, 1.0) + background Transform(Image("gui/creamy_pumpkin_pie/textbox.png", xalign=0.5, yalign=1.0, oversample=4), alpha=0.5) style what: xpos 0.5 - ypos 20 - xsize 1000 - xoffset -480 + ypos 10 + xsize 500 + xoffset -240 color "#fff" - outlines [(3, "#000000", 1, 1)] + outlines [(2, "#000000", 1, 1)] hinting "bytecode" - size 32 + size 24 justify True style namebox: - ysize 43 # Halved due to oversampling - padding (50, 0, 50, 0) + ysize 22 # Halved due to oversampling + padding (32, 0, 32, 0) fit_first True xpos 0.5 yalign 1.0 xanchor 0.0 - offset (-570, -250) - background Transform(Frame("gui/creamy_pumpkin_pie/namebox.png", 48, 0, 48, 0, oversample=2, tile=True), alpha=0.5) + offset (-320, -125) + background Transform(Frame(Image("gui/creamy_pumpkin_pie/namebox.png", oversample=4), 32, 0, 32, 0, tile=True), alpha=0.5) style who: color "#EA8E61" - outlines [(3, "#000000", 1, 1)] + outlines [(2, "#000000", 1, 1)] hinting "auto" font gui.bold_font - size 42 + size 32 style quickbox is namebox: - padding (50, 0, 50, 0) + padding (32, 0, 32, 0) xanchor 1.0 - xoffset 570 + xoffset 320 style hider is namebox: align (0.5, 1.0) @@ -192,6 +189,15 @@ transform gui_perspective_hover: easein 0.1 matrixtransform ScaleMatrix(1.05, 1.05, 1.05) easeout 0.1 matrixtransform ScaleMatrix(1.0, 1.0, 1.0) +transform gui_show_hide(new_widget=None, old_widget=None): + delay 0.1 + on start: + alpha 0 + zoom 1.05 + easein 0.1 zoom 1.00 alpha 1 + on hide: + easeout 0.1 zoom 0.95 alpha 0 + style choice_vbox is vbox style choice_button is button style choice_button_text is button_text diff --git a/game/scripts/options.rpy b/game/scripts/options.rpy index dc9e72d2..4ea5b79f 100644 --- a/game/scripts/options.rpy +++ b/game/scripts/options.rpy @@ -120,15 +120,15 @@ define config.game_main_transition = f3 define config.end_splash_transition = d3 define config.end_game_transition = fade define config.after_load_transition = fade -define config.window_show_transition = d3 -define config.window_hide_transition = d3 +define config.window_show_transition = None +define config.window_hide_transition = None define config.adv_nvl_transition = d3 define config.nvl_adv_transition = d3 define config.enter_yesno_transition = None define config.exit_yesno_transition = None define config.enter_replay_transition = None define config.exit_replay_transition = None -define config.say_attribute_transition = d3 +define config.say_attribute_transition = None # Engine Compatibility define config.check_conflicting_properties = True