documentation index ◦ reference manual ◦ function index
Function: | layout.imagemap_yesno_prompt | (ground, idle, hover, hotspots, prompt_images={}): |
This layout uses an imagemap to handle prompting the user with yes/no questions.
ground - The displayable used for disabled buttons, and areas that are not in a hotspot.
idle - The displayable used for unfocused hotspots.
hover - The displayable used for focused hotspots.
hotspots - A list of tuples defining the hotspots. Each tuple consists of
prompt_images - A map listing prompt images to be used instead of prompt text.
When a prompt is to be shown, it is first looked up in prompt_images. If a message image is found, then it is shown to the user. Otherwise, the default prompt (layout.ARE_YOU_SURE) is looked up, and if it is found, that image is shown to the user. Otherwise, the prompt is rendered as text.
Placement of a prompt image is controlled by style properties associated with the image. Placement of the prompt text can be controlled using style.yesno_prompt, with the style of the text proper being controlled by style.yesno_prompt_text.
Currently-used prompts are:
Hotspot functions may also include the untranslated names of game menu buttons. If at least one such button is defined, the navigation is not shown, and the imagemap is expected to define all relevant game menu buttons.
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, unless the game menu buttons are defined here.
init -2 python: layout.imagemap_yesno_prompt( "yesno_ground.png", "yesno_idle.png", "yesno_hover.png", [ (211, 228, 320, 280, "Yes"), (490, 228, 575, 280, "No"), ], { layout.ARE_YOU_SURE : "yesno_are_you_sure.png", layout.DELETE_SAVE : "yesno_delete_save.png", layout.OVERWRITE_SAVE : "yesno_overwrite_save.png", layout.LOADING : "yesno_loading.png", layout.QUIT : "yesno_quit.png", layout.MAIN_MENU : "yesno_main_menu.png", } )