Ren'Py Renpy Help - Screens

TastyGames

Newbie
Mar 4, 2020
20
103
Hi all. Looking for some help with something I think should be fairly simple.

The righthand facing arrow toggles the visibility of the score bar. At the moment the arrow is static regardless of whether the scorebars are being displayed. I would like to have the arrow replaced with an opposite facing arrow when the scorebars are hidden.

example.png

The code for the arrow:

Code:
screen showhidescore:
    button:
        background "gui/hidescore.png" xpos 1890 ypos 43
        action If(renpy.get_screen("score"), true=Hide("score"), false=Show("score"))

And the code for the bars themselves:

Code:
screen score:

    bar value StaticValue(ap, 10):
        xpos 1630 ypos 20
        xmaximum 250
        ymaximum 37
        yminimum 0
        base_bar Frame("gui/apbar.png", 250, 15)
        thumb "gui/heart.png"
        thumb_offset 4.5
        thumb_shadow None

    bar value StaticValue(d, 10):
        xpos 1630 ypos 55
        xmaximum 250
        ymaximum 37
        yminimum 0
        base_bar Frame("gui/dbar.png", 250, 12)
        thumb "gui/devilheart.png"
        thumb_offset 4.5
        thumb_shadow None
Anyone have any ideas?
 

the66

beware, the germans are cumming
Modder
Donor
Respected User
Jan 27, 2017
7,808
24,388
Python:
screen showhidescore():
    $ img = (im.Flip("gui/hidescore.png", horizontal=True) if renpy.get_screen("score") else "gui/hidescore.png") #or use a 2nd dedicated image
    imagebutton:
        xpos 1890 ypos 43
        idle img
        action ToggleScreen("score")
 
  • Like
Reactions: TastyGames