layout.imagemap navigation - Ren'Py Visual Novel Engine

documentation index ◦ reference manual ◦ function index

# layout.imagemap_navigation

Function: | layout.imagemap_navigation | (ground, idle, hover, selected_idle, selected_hover, hotspots):

This layout uses an imagemap to handle game menu navigation.

ground - The displayable used for disabled buttons, and areas that are not in a hotspot.

idle - The displayable used for unfocused unselected hotspots.

hover - The displayable used for focused unselected hotspots.

selected_idle - The displayable used for unfocused selected hotspots.

selected_hover - The displayable used for focused selected hotspots.

hotspots - A list of tuples defining the hotspots. Each tuple consists of

1. The x-coordinate of the left side.
2. The y-coordinate of the top side.
3. The x-coordinate of the right side.
4. The y-coordinate of the bottom side.
5. The (untranslated) name of the game menu button this hotspot is equivalent to.

Despite the name, this function can take arbitrary displayables as well as images.

    init -2 python:
        layout.imagemap_navigation(
            "gm_ground.jpg",
            "gm_idle.jpg",
            "gm_hover.jpg",
            "gm_selected_idle.jpg",
            "gm_selected_hover.jpg",
            [
                (26, 485, 168, 535, "Return"),
                (245, 485, 410, 535, "Save Game"),
                (522, 485, 688, 535, "Load Game"),
                (104, 535, 286, 589, "Preferences"),
                (374, 535, 550, 589, "Main Menu"),
                (675, 535, 790, 589, "Quit"),
                ])

documentation index ◦ reference manual ◦ function index