layout.imagemap preferences - Ren'Py Visual Novel Engine

documentation index ◦ reference manual ◦ function index

# layout.imagemap_preferences

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

This layout uses an imagemap to handle preferences.

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 function of this hotspot.

There are two kinds of hotspots, buttons and bars. The buttons are:

- "Window", "Fullscreen" - The display preference.
- "All", "Some", None" - The transition preferences.
- "Joystick" - The button used to jump to the joystick preferences.
- "Seen Messages", "All Messages" - Control which messages are skipped.
- "Begin Skipping" - Forces skipping to begin.
- "Stop Skipping", "Keep Skipping" - Control skipping at menus.
- "Sound Test", "Voice Test" - Test the corresponding audio channels.

The other type of hotspot is a horizontal bar. The selected images are used for the full portion of the bar, while the unselected images are used for the empty part of the bar. The known bars are:

- "Music Volume"
- "Sound Volume"
- "Voice Volume"
- "Auto-Forward Time"
- "Text Speed"

Despite the name, this function can take arbitrary displayables as well as images. The images or displayables used should be transparent to allow the navigation to show through.

    init -2 python:
        layout.imagemap_preferences(
            "prefs_ground.png",
            "prefs_idle.png",
            "prefs_hover.png",
            "prefs_selected_idle.png",
            "prefs_selected_hover.png",
            [
                (38, 62, 170, 121, "Window"),
                (175, 62, 296, 121, "Fullscreen"),
                (105, 150, 200, 185, "All"),
                (205, 150, 294, 185, "None"),
                (180, 300, 318, 339, "Joystick"),
                (410, 63, 479, 102, "Seen Messages"),
                (480, 63, 535, 102, "All Messages"),
                (384, 106, 548, 144, "Begin Skipping"),
                (403, 198, 466, 237, "Stop Skipping"),
                (467, 198, 543, 237, "Keep Skipping"),
                (725, 181, 790, 213, "Sound Test"),

                (564, 53, 788, 87, "Music Volume"),
                (565, 136, 789, 170, "Sound Volume"),
                (564, 252, 788, 286, "Voice Volume"),
                (318, 287, 542, 321, "Auto-Forward Time"),
                (56, 233, 278, 268, "Text Speed"),
                ])

documentation index ◦ reference manual ◦ function index