1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drop down HUD

Discussion in 'Programming & Development' started by Chatterbox, Sep 14, 2018.

  1. Chatterbox

    Chatterbox Active Member Game Developer

    142
    142
    May 28, 2018
    Does anyone know how to make a drop down menu work in Ren'py?

    Here's what I'm doing. I have a calendar and a stats button. Both are added in the game script files as:

    Window show
    Show screen stats_button

    Here is the code, although I've really only added the images so far.

    screen calendar() tag calendar:

    modal False

    imagebutton:
    idle "cal_icon" xalign 0.975 yalign 0.03 action NullAction()
    text day_calendar xalign 0.965 yalign 0.06 size 50 color "#000000"

    screen stats_button() tag statsbutton:

    modal False

    imagebutton:
    idle "stats_button" hover "stats_button_hover" xalign 0.975 yalign 0.15 focus_mask True action ShowMenu("points_hud")

    screen points_hud() tag pointshud:

    modal False

    imagebutton:
    idle "points_hud" hover "points_hud_hover" xalign 0.975 yalign 0.55 focus_mask True action ShowMenu("stats_lexi")
    text "[love_stats_lexi]" xalign 0.975 yalign 0.25 size 20 color "#ffffff"

    imagebutton:
    idle "stats_button" hover "stats_button_hover" xalign 0.975 yalign 0.15 focus_mask True action ShowMenu("stats_button")

    What I'm trying to do with this is I have a stats button on the screen, and that works fine. When I click on it, it should show a stats display (points_hud), which it does. Then I want to be able to click on the stats button again to hide the display(points_hud). I have two problems:

    1. It pauses the game. The dialog screen disappears and the player can't move the game forward until I hit the left mouse button to go back.

    2. Clicking the Stats Button again does not hide the Points Hud.

    Any idea what I've got wrong here?

    Thanks,
    Chatterbox
     
  2. Chatterbox

    Chatterbox Active Member Game Developer

    142
    142
    May 28, 2018
    Never mind...figured it out.
     
  3. Rich

    Rich Well-Known Member Modder Game Developer

    496
    1,588
    Jun 25, 2017
    For future reference, please put your code inside "code" tags when posting it. Indentation is important in Ren'py - this way it won't get lost.
     
    Chatterbox likes this.