I am currently working on coding my game, and have a stats screen where players can look at how much money they have, along with the time of day. I'd like to tuck this part of the menu away - and here's what it currently looks like idle/unhovered:
And here's what it looks like when hovered over and it reveals the amount of money the player has at the top right:
I was wondering if, along with hovering, it would be possible to have this stat appear/disappear if they pressed the "1" button on their keyboard?
Here's what the code for my screen currently looks like:
Code: Select all
screen player_stats():
zorder 100
imagemap:
ground "gui/money-amount-idle.png"
hover "gui/money-amount-hover.png"
hotspot (1621, 33, 300, 67) action Show("cash_amount") hovered ShowTransient("cash_amount") unhovered Hide("cash_amount")
screen cash_amount():
zorder 100
hbox:
xalign 0.965 yalign 0.0422
text "{size=28} {color=#ffffff} Cash: $[Cash]{/size}{/color}"
if Cash < 0:
$ Cash = 0