Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
So I've been trying to learn how to use scrollable screens, and whenever I interact with something on the screen, the screen jumps to the center of the image before displaying text, regardless of where the user was when the image was interacted with.
I include the "Show test_bg" line just so that there is something displayed after clicking the imagebutton, otherwise it displays no backgrounds. Is there something I could do to keep the screen from returning to the center after clicking the imagebutton?
This is my first post here and I'm a total noob at this stuff, so apologies if this is written poorly lol.
Last edited by Cat_Bardy on Sat Apr 08, 2023 10:45 am, edited 1 time in total.
Thank you, that helps with keeping the screen remembering where it was, but is there a way to apply this to the image after interacting with the imagebutton? The "Show test_bg" is still displays the image at the center. Is there a way to apply the " xadjustment screen_scroll " to the image somehow? Or maybe a way to keep the screen from hiding itself after interacting with the imagebutton?
Cat_Bardy wrote: ↑Fri Apr 07, 2023 2:12 pm
Thank you, that helps with keeping the screen remembering where it was, but is there a way to apply this to the image after interacting with the imagebutton? The "Show test_bg" is still displays the image at the center. Is there a way to apply the " xadjustment screen_scroll " to the image somehow? Or maybe a way to keep the screen from hiding itself after interacting with the imagebutton?
You can reshow screen with show screen statement. It might make sense to add argument to control if the screen is interactive or just background
screen scrolling_screen(interact = True):
viewport:
xadjustment screen_scroll
child_size(2600,1080)
arrowkeys interact
if interact:
edgescroll (300,2000)
add "test_bg.png"
if interact:
imagebutton:
auto "test_door_%s.png" focus_mask True
action Jump ("scroll_test")
In this case you can use call screen scrolling_screen() for interaction and show screen scrolling_screen(interact = False) to show screen as a backgound
Cat_Bardy wrote: ↑Fri Apr 07, 2023 2:12 pm
Thank you, that helps with keeping the screen remembering where it was, but is there a way to apply this to the image after interacting with the imagebutton? The "Show test_bg" is still displays the image at the center. Is there a way to apply the " xadjustment screen_scroll " to the image somehow? Or maybe a way to keep the screen from hiding itself after interacting with the imagebutton?
You can reshow screen with show screen statement. It might make sense to add argument to control if the screen is interactive or just background
screen scrolling_screen(interact = True):
viewport:
xadjustment screen_scroll
child_size(2600,1080)
arrowkeys interact
if interact:
edgescroll (300,2000)
add "test_bg.png"
if interact:
imagebutton:
auto "test_door_%s.png" focus_mask True
action Jump ("scroll_test")
In this case you can use call screen scrolling_screen() for interaction and show screen scrolling_screen(interact = False) to show screen as a backgound