documentation indexreference manualfunction index

Contents

  • 1 User-Defined Displayables
    • 1.1 renpy.Displayable
    • 1.2 renpy.Render
    • or ui.callsinnewcontext to call the _game_menu label with a parameter, the name of the screen you wish to enter. This parameter can be omitted to enter the default screen.

      This can be omitted to use the default screen.

      init python:
          def overlay():
               # We can assume that "save_screen" is the default.
               ui.textbutton("Save", clicked=ui.callsinnewcontext("_game_menu"), xalign=0.0, yalign=0.0)
               ui.textbutton("Prefs", clicked=ui.callsinnewcontext("_game_menu", "preferences_screen"), xalign=1.0, yalign=0.0)
      
          config.overlay_functions.append(overlay)
      
      ./usr/share/doc/renpy/html/reference/NVL_Mode.html0000644000000000000000000001454411011460424020722 0ustar rootrootrenpy/doc/reference/NVL Mode - Ren'Py

      documentation indexreference manualfunction index

      NVL Mode

      NVL mode is a mode in which Ren'Py shows more than one line of dialogue on the screen at once. This is used to better emulate the Japanese visual novel format, whereas the default settings of Ren'Py emulate the Japanese adventure format.

      To use NVL-mode, one must declare Characters with a kind of `nvl`, or with a kind that has a kind of `nvl`. For example:

      The narrator can also be made an NVLCharacter, by setting the narrator variable to an NVLCharacter with the name of None.

      init:
          $ e = Character("Eileen", color="#c8ffc8", kind=nvl)
          $ narrator = NVLCharacter(None, kind=nvl)
      

      When dialogue is spoken with an NVL-mode Character, it is added to the end of a buffer, and then the entire contents of that buffer are shown to the user. The buffer can be cleared using the nvl clear statement. It should be cleared before the first use.

      nvl clear
      
      e "This is the first line of the first screen."
      
      e "This is the second line of the first screen."
      
      nvl clear
      
      e "This is the first line of the second screen."
      
      e "This is the second line of the second screen."
      
      

      The nvl show transition statement causes a transition to occur from the previous screen to a screen with the buffer shown. The nvl hide transition statement causes a transition to occur from a screen with the buffer shown to a screen without the buffer shown.

      Menus. The nvl_menu function shows a menu in NVL-mode. To use it, it should be assigned to menu in an init block, using code like:

      init:
          $ menu = nvl_menu
      

      As nvl-mode menus are shown without being added to the buffer, we suggest clearing the buffer (using nvl clear) immediately after each menu.

      Functions

      For each of the nvl-mode statements, there is an equivalent python function. There is also a function with no statement equivalent.

      Function: nvl_clear ():

      Equivalent to nvl clear.

      Function: nvl_hide (transition):

      Equivalent to nvl hide transition.

      Function: nvl_show (transition):

      Equivalent to nvl show transition.

      Function: nvl_erase ():

      Calling this function erases the bottom line on the NVL-mode screen. If there are no lines on the NVL-mode screen, does nothing. This can be used to replace the bottom line with something else, or to re-show it with different text.


      Variables

      Variable: config.nvl_page_ctc = None

      If not None, this is expected to be a displayable that gives a click-to-continue indicator that is to be used when the current line of NVL-mode dialogue is followed by a `nvl clear` statement.

      Variable: config.nvl_page_ctc_position = "nestled"

      Gives the position of the click-to-continue indicator when when config.nvl_page_ctc is used. See the ctc_position argument to Character for legal values.

      Variable: config.nvl_paged_rollback = False

      When true, changes the rollback mechanism to display entire pages of rollback at a time. For this to work, page-ends need to be predictable, which generally means nvl clear statements should immediately follow nvl-mode dialogue. (As opposed to occuring only after a page has finished.) This doesn't work well when mixing ADV and NVL modes, as the idea of a page isn't well-defined in that case.

      ./usr/share/doc/renpy/html/reference/Overlays.html0000644000000000000000000001011211011460423021105 0ustar rootrootrenpy/doc/reference/Overlays - Ren'Py

      documentation indexreference manualfunction index

      Overlays

      Overlays are used to display information above the scene currently displayed. The overlay is regenerated each time an interaction with the user begins, making it suitable for displaying to the user things like statistics or dates. The overlay is generally displayed whenever transient things (like dialogue, thoughts and menus) are.

      Overlays are set up by adding to the config.overlay_functions list a Python function which, when called, uses the ui functions to add widgets to the screen. By default, such widgets are added to the 'overlay' layer, but a call to ui.layer can change the layer to any of the layers listed in config.overlay_layers. These functions are called for each interaction, which allows the overlay to change to reflect the status of game variables. If a variable affecting the overlay changes during an interaction, renpy.restart_interaction should be called to regenerate the overlay.

      As an example, take the following code fragement. When added to a program, this displays a date image in the upper-right corner of the screen (as is done in Kanon). The image shown is based on the variable date. If date is None, then no date is shown. Otherwise, a png file beginning with the value of date is shown.

      init:
          $ date = "mar25"
      
          python hide:
              def date_overlay():
                  if date:
                      ui.image(date + ".png",
                               xpos=1.0, xanchor="right",
                               ypos=0.0, yanchor="top")
      
              config.overlay_functions.append(date_overlay)
      

      Like all config variables, config.overlay_functions should only be changed in an init block. If you need to toggle an overlay on and off, then the overlay function should be conditioned on some normal variable. This is done in the example above when date is None.

      ./usr/share/doc/renpy/html/reference/User-Defined_Displayables.html0000644000000000000000000004037011011460424024261 0ustar rootrootrenpy/doc/reference/User-Defined Displayables - Ren'Py