Nurik Zhumashev
Nurik Zhumashev

Reputation: 3

How to use function in Show() in Renpy?

How can I display my dictionary on another screen?

define python:
    heroes = { Someone : 1, Someone: 2}

screen showBio(id, dict):
    frame:
        xsize 300
        ysize 300
        vbox:
            text "[dict[id]]"

screen characters():
    tag menu
    use game_menu(_("Heroes"), scroll="viewport"):
        for i in heroes:
            textbutton "[i]" action Show("showBio([i], [heroes])")

Upvotes: 0

Views: 526

Answers (1)

c_c0710
c_c0710

Reputation: 18

define python:
    heroes = {"Someone": 1, "Someone2": 2}
    
screen showBio(id, hero_dict):
    frame:
        xsize 300
        ysize 300
        vbox:
            text str(hero_dict[id])
    
screen characters():
    tag menu
    use game_menu(_("Heroes"), scroll="viewport"):
        for i in heroes:
            textbutton i action Show("showBio", i, hero_dict=heroes)

Upvotes: 0

Related Questions