renpy/doc/cookbook/Menu Positions

From Ren'Py

Jump to: navigation, search

Menu Positions

This shows how to reposition the elements of the main menu. Elements of the game menu can be repositioned in a similar way. Use the style inspector (shift+I with your mouse over a displayable) to figure out which styles to use.

Layouts may be easier to use for more complicated designs.

init python hide:

    # Expand the main menu frame to be transparent, and taking up the
    # screen. Set the box inside it to one that absolutely positions
    # its children.
    style.mm_menu_frame.clear()
    style.mm_menu_frame.set_parent(style.default)
    style.mm_menu_frame_box.box_layout = "fixed"

    style.mm_button["Start Game"].xpos = 400
    style.mm_button["Start Game"].ypos = 400

    style.mm_button["Continue Game"].xpos = 450
    style.mm_button["Continue Game"].ypos = 450

    style.mm_button["Preferences"].xpos = 500
    style.mm_button["Preferences"].ypos = 500

    style.mm_button["Quit"].xpos = 550
    style.mm_button["Quit"].ypos = 550

Personal tools