How to create a menu that shows Relationships, Money and Date/Time?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Trafagal
Regular
Posts: 100
Joined: Mon Apr 29, 2019 9:32 am
Contact:

How to create a menu that shows Relationships, Money and Date/Time?

#1 Post by Trafagal »

Hi,

I'm trying to figure this thing out but I guess my programming is not that good.
I want to show the money, date and relationships on the top bar of my game:
game and date.JPG
I have asked a few nice peeps and they suggested the codes to go like this..

In screen.rpy

Code: Select all

screen overlay():
    hbox:
        xalign 0.5
        ypos 5

        hbox:
            add "moneyImage"
            text "Money: [moneyVar]"

        text "[dayVar] [timeVar]"

        text "Day: [dayCountVar]"
In script.rpy:

Code: Select all

init python:
    money=100
screen Moneydisplay:
    text "Money: [money]"

label getmoney:
    show screen Moneydisplay
    "Here, have some cash"
    $ money+=100
    "Thanks!"

But it doesn't seems to work. Can anyone advise? Thank you.
Check out some of my stuffs here:https://linktr.ee/theartofjoshlab

Art Portfolio: https://www.instagram.com/theartofjoshlab/

Working on a personal Visual Novel~

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Contact:

Re: How to create a menu that shows Relationships, Money and Date/Time?

#2 Post by hell_oh_world »

why do you have screen overlay and at the same time a screen Monedisplay?
the former seems to be what you're looking for, so you need to show that instead of the other.

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: How to create a menu that shows Relationships, Money and Date/Time?

#3 Post by rayminator »

it should look something like this

Code: Select all

screen Moneydisplay():
    add "moneyImage" xalign 0.5 ypos 5
    hbox:
        text "Money: [moneyVar]" xalign 0.0 ypos 0 ## adjust xalign and ypos
        text "[dayVar] [timeVar]" xalign 0.0 ypos 0 ## adjust xalign and ypos
        text "Day: [dayCountVar]" xalign 0.0 ypos 0 ## adjust xalign and ypos

Post Reply

Who is online

Users browsing this forum: No registered users