[solved] redrawing the screen despite ui.interact

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.
Post Reply
Message
Author
User avatar
kuroi
Regular
Posts: 129
Joined: Fri Jun 29, 2007 10:50 am
Location: Albuquerque, New Mexico, USA
Contact:

[solved] redrawing the screen despite ui.interact

#1 Post by kuroi » Sat Sep 12, 2009 1:50 pm

Hello out there in Renpy Land~
I'm getting close to done on Kuroi Games newest project. Yay! It's a manga so I'm dealing with a few problems that I haven't run into before and I was hoping that there might be someone more tallented than myself out there who could give me a hand.

I have a loop which basicly runs like this:

Code: Select all

while result != "end":
    Draw_The_Page()
    _result = ui.interact()
    Handle_User_Input()
So, the code draws the page and then sits around waiting for the user to do something. However, I have an option in the preferences which allows the user to flip the page and read the manga either left to right (english style) or right to left (japanese style). Unfortunately, when the user clicks the option, Renpy still sits around waiting for ui.interact() to tell it that the user has done something before it will redraw the screen.

I have tried simply calling my Draw_The_Page() functon again when the button to change the read direction is pressed but renpy still waits for ui.interact() to tell it that there has been some user interaction before doing anything...

Is there any way to force Renpy to go past ui.interact() a single time so that the loop can redraw the screen?

Thanks a ton for the help~
Kuroi
Last edited by kuroi on Sat Sep 12, 2009 4:50 pm, edited 1 time in total.
President, Planner, and Programmer for Kuroi Games!

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: redrawing the screen despite ui.interact

#2 Post by PyTom » Sat Sep 12, 2009 2:43 pm

The easiest way would be to have a ui.timer break you out of the interact once in a while.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
kuroi
Regular
Posts: 129
Joined: Fri Jun 29, 2007 10:50 am
Location: Albuquerque, New Mexico, USA
Contact:

Re: redrawing the screen despite ui.interact

#3 Post by kuroi » Sat Sep 12, 2009 4:49 pm

Thanks so much~
I used the ui.timer to break me out but it ended up making the vbar on my image map flash but it let me in the right direction and I solved it by calling:
$ renpy.jump_out_of_context ("loop")
inside of the code called when the button is pressed and that works just fine!

Thanks again~ I may have been stuck forever without your help. =)
President, Planner, and Programmer for Kuroi Games!

Post Reply

Who is online

Users browsing this forum: Alex, Google [Bot], nyeowmi