How to make Key Scroll viewport AND do another action?[SOLVED]
Posted: Fri Jan 26, 2024 4:14 pm
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!
Code: Select all
# The scrollable text message viewport
viewport id "vp":
xoffset 80
if persistent.iphone:
yoffset 160
else:
yoffset 130
xsize vp_xsize
ysize vp_ysize
mousewheel True
xadjustment xadj
yadjustment yadj
has vbox
spacing 10
Code: Select all
key "K_RETURN" action Play("sound","audio/SendText.ogg") , If(current_text_num < text_class_size, SetVariable("current_text_num", current_text_num+1),Return)
key "mousedown_1" action Function(yadj.change, yadj.value + 10), renpy.restart_interaction
Thanks for any help!