renpy/doc/cookbook/About this game

From Ren'Py Visual Novel Engine

Jump to: navigation, search

How to add an "about" item to the main menu

Quite simple, really. Make a new text file, name it about.rpy and put the following text in it. Modify as necessary.

init:
    # Adding about button to main menu
    $ config.main_menu.insert(3, ('About', _intra_jumps("about", "main_game_transition"), "True"))

# About box
label about:
    python hide:
        renpy.transition(config.intra_transition)
        ui.window(style=style.gm_root)
        ui.frame(ymargin=10, xmargin=10, style=style.menu_frame)
        ui.side(['t', 'c', 'r', 'b'], spacing=2)

        # Here you put the title of your VN
        layout.label("My visual novel", None)

        vp = ui.viewport(mousewheel=True)

        # This is where the text will go. You can use all the usual tags.
        ui.text("This is my first visual novel, be gentle, thank you.. :)")
        ui.bar(adjustment=vp.yadjustment, style='vscrollbar')

        layout.button(u"Return to menu", None, clicked=ui.jumps("main_menu_screen"))
        ui.close()
        ui.interact()
    return

In case you don't want a label remove layout.label( ) and change ui.side( ): The 't' (top) part must be removed, or else Ren'Py will throw an "error: Invalid resolution for Surface".

        ui.side(['c', 'r', 'b'], spacing=2)
Personal tools