Page 1 of 1
How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 3:23 pm
by Hudacious
Hey everyone, i'm really stuck. I've been wanting to create a GUI screen or just basic UI screen at the top of my game that displays the player's current gold count.
Any ideas on how it could be done? Thanks.
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 4:23 pm
by gamerbum
I haven't needed to do it and thus haven't actually tried, but couldn't you theoretically just add it on as a section of the quick menu screen (since that displays while you're actively playing the game) and to display the player's total gold, simply have it call the variable that counts gold?
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 4:25 pm
by Hudacious
gamerbum wrote:I haven't needed to do it and thus haven't actually tried, but couldn't you theoretically just add it on as a section of the quick menu screen (since that displays while you're actively playing the game) and to display the player's total gold, simply have it call the variable that counts gold?
How would I do that? I'm really new to Renpy so i like to know the steps to absolutely everything.
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 4:54 pm
by Iylae
What you're looking for is answered here
viewtopic.php?f=8&t=40010#p426163
Considering this was posted only two days ago, you really should try and look for things before asking questions. The simpler the question the more likely the answer exists already.
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 5:07 pm
by Hudacious
Iylae wrote:What you're looking for is answered here
viewtopic.php?f=8&t=40010#p426163
Considering this was posted only two days ago, you really should try and look for things before asking questions. The simpler the question the more likely the answer exists already.
In all fairness, the topic was titled something much different than what I was directly looking for. This tends to be the issue in situations like these.
One more question, because of that topic, i've been able to successfully pull it off. The only issue now is that there is no background behind the text. How at all could I do that? Thanks
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 5:17 pm
by Alex
Re: How to make a Gui Screen that displays your money.
Posted: Sun Aug 28, 2016 5:37 pm
by Hudacious
Thanks for the reply, I've been practicing around with it but so far i've come up with nothing successful. Sadly for me, i'm the type of person who learns from examples rather than pre-context statements.
Lets say for instance that I use this code.
Code: Select all
default hp = 10
screen stats():
text "HP: [hp]"
label start:
show screen stats
"Game starts."
$hp = 5
"You now have 5 hp, you can see that on the screen."
How exactly would I put the frame behind the output? I really do apologise if it seems like i'm asking to be spoonfed, it really isn't my intention, I just learn much faster through solid examples.
Re: How to make a Gui Screen that displays your money.
Posted: Mon Aug 29, 2016 3:42 am
by kivik
Code: Select all
screen stats():
frame:
text "HP: [hp]"
This should do it. As the example code shows, screen can contain frames, so you just need to add the frame: tag and indent what you want inside the frame beneath that line.
You can pretty much mix and match, so you can have text within a hbox within frame within a vbox within a window within a screen.
Re: How to make a Gui Screen that displays your money.
Posted: Mon Aug 29, 2016 9:42 am
by papiersam
Don't forget
zorder if you want the screen to stay above the other screens and all.