documentation indexreference manualfunction index

ui.interact

Function: ui.interact (**kwargs):

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 renpy.last_interact_type 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 renpy.roll_forward_info and renpy.checkpoint.

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!"



documentation indexreference manualfunction index