This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


ui.interact

Displays the current scene to the user, waits for a widget to indicate a return value, and returns that value to the user. As a side-effect, disables fast skip mode when executed.

Some useful keyword arguments are:

type - The type of this interaction. See for more details.

show_mouse - Should the mouse be shown during this interaction? Only advisory, as this doesn't work reliably.

suppress_overlay - This suppresses the display of the overlay during this interaction.

suppress_underlay - This suppresses the underlay during this interaction. The underlay contains the key and mouse bindings that let the user access the game menu. (As well as a number of other useful in-game functions.)

suppress_window - This suppresses the showing of an empty window when it otherwise would be shown.

roll_forward - The value returned if the user tries to roll forward. This is normally used in conjunction with and .

clear - If True, the transient layer will be cleared at the end of the interaction.

Example

$ ui.vbox(xalign=0.5, yalign=0.5)
$ ui.textbutton("Choice 1", clicked=ui.returns(1))
$ ui.textbutton("Choice 2", clicked=ui.returns(2))
$ ui.close()

$ result = ui.interact()
if result == 1:
    "You picked choice 1!"
else:
    "Choice 2 was for you!"