Bar at the top of the screen

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
bonnet1902
Newbie
Posts: 2
Joined: Mon Apr 06, 2020 11:27 am
Contact:

Bar at the top of the screen

#1 Post by bonnet1902 »

I am a beginner at Ren'py and was experiencing difficulties in making a bar at the top of the screen which displays some clickable images and some just for show.

Currently, I have this code:
screen topBar():
frame:
xpos 0
ypos 0
xsize 1920
ysize 75
hbox:
text str(mc.name)
text str(mc.cash)

However, I am unsure of how to display this bar on top all the time.
I tried "use topBar" in screens, but I only managed to get to show anytime a character said something.

Any help is greatly appreciated.
Thank you :)

User avatar
PastelWolf88
Newbie
Posts: 16
Joined: Sun Mar 12, 2017 12:13 pm
Completed: They Would Call You Broken
Projects: The Moonstone Sword, The Violet Girls
itch: natekauko
Location: Finland
Contact:

Re: Bar at the top of the screen

#2 Post by PastelWolf88 »

What you're trying to do is essentially similar to what the quick menu does. You should look at its code in the screens.rpy file.

It also has this block in there:

Code: Select all

## This code ensures that the quick_menu screen is displayed in-game, whenever
## the player has not explicitly hidden the interface.
init python:
    config.overlay_screens.append("quick_menu")

bonnet1902
Newbie
Posts: 2
Joined: Mon Apr 06, 2020 11:27 am
Contact:

Re: Bar at the top of the screen

#3 Post by bonnet1902 »

Thank you this is exactly what I needed.

Much appreciated. 👍

Post Reply

Who is online

Users browsing this forum: Google [Bot], Semrush [Bot]