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.
I am making a text messaging system for my game and need help making the phone screen viewport show the next text message and scroll down at the same time. here are the code sections
if I set both key values to "K_RETURN" instead of working like I want the Return key does no action at all in game. I know I need the IF statement to finish first then run the yadj function.. how can I make the key "K_RETURN" do both in that order when it's pressed?
Thanks for any help!
Last edited by Thomas_Blue on Sat Jan 27, 2024 1:24 pm, edited 1 time in total.
Thomas_Blue wrote: ↑Fri Jan 26, 2024 4:14 pm
if I set both key values to "K_RETURN" instead of working like I want the Return key does no action at all in game. I know I need the IF statement to finish first then run the yadj function.. how can I make the key "K_RETURN" do both in that order when it's pressed?
You shouldn't add two keys with the same values to begin with.
Just add the adjustment to the list of stuff to execute when pressing the return key. You may want to change yadj to float("inf") meaning the highest possible number. You do not have to restart interaction in my opinion.
If this doesn't fix the problem, maybe it's because the viewport isn't showing the text in the moment the adjustment should happen. In this case you just can make the screen update it's adjustment with each draw automatically or delay the adjustment with a timer.
Auto adjust (assuming you have a viewport inside):