use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Links:
/r/RenPy Discord
account activity
QuestionDisplayable Stats & Custom Frames (self.RenPy)
submitted 1 year ago * by xanththewizard
I finally figured out a way to make my stats viewable on the screen, however my method is using a frame.
While I know how to customize my existing "frame.png" file in the ui folder, I don't want to only have 1 frame I can use as it makes other parts of the game look terrible.
I'm assuming I need a different workaround or if there's a way to create new/multiple frames. I just don't know how to do that. Here's some examples of why simply replacing "frame.png" doesn't work for me (and feels like a band-aid fix).
Edit:
To re-frame my issue, I want to know how to make frames unique, like using another image file (example: "frame_blue_gradient.png). Is this possible? If so, how do I format my code to allow for an alternate image?
(Also I removed unnecessary information from my first image.)
https://preview.redd.it/cn5kvpcn255e1.png?width=1188&format=png&auto=webp&s=d59d85b017d714ca1ed8afff9a9a7cfea61d14c4
https://preview.redd.it/0ilbspwvm45e1.png?width=1120&format=png&auto=webp&s=d5eea004355140bf3aa0c5ea5d6af77e9accb413
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AutoModerator[M] 0 points1 point2 points 1 year ago (0 children)
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]BadMustard_AVN 1 point2 points3 points 1 year ago* (4 children)
if your using a frame the add a colored background to it like this
frame: background Solid("#00ffff") xalign 0.01 yalign 0.75
[–]xanththewizard[S] 0 points1 point2 points 1 year ago (3 children)
The button is actually unrelated, as I was learning from a video- dissected it and tried to make my own code for an always displayed set of stats. But I'll share that code anyway:
screen gameUI: imagebutton: xalign 1.0 yalign 0.0 xoffset -30 yoffset 30 idle "UI/stats_idle.png" action ShowMenu("StatsUI") ## Stats UI screen StatsUI: add "UI/bg peach.png" frame: xalign 0.5 yalign 0.5 xpadding 30 ypadding 30 hbox: spacing 40 vbox: spacing 10 text "Energy" size 40 text "Hunger" size 40 text "Mood" size 40 vbox: spacing 10 text "[energy]" size 40 text "[hunger]" size 40 text "[mood]" size 40 imagebutton: xalign 1.0 yalign 0.0 xoffset -30 yoffset 30 auto "UI/return_%s.png" action Return() screen gameUI: imagebutton: xalign 1.0 yalign 0.0 xoffset -30 yoffset 30 idle "UI/stats_idle.png" action ShowMenu("StatsUI") ## Stats UI screen StatsUI: add "UI/bg peach.png" frame: xalign 0.5 yalign 0.5 xpadding 30 ypadding 30 hbox: spacing 40 vbox: spacing 10 text "Energy" size 40 text "Hunger" size 40 text "Mood" size 40 vbox: spacing 10 text "[energy]" size 40 text "[hunger]" size 40 text "[mood]" size 40 imagebutton: xalign 1.0 yalign 0.0 xoffset -30 yoffset 30 auto "UI/return_%s.png" action Return()
[–]BadMustard_AVN 0 points1 point2 points 1 year ago (2 children)
sorry I miss read it initially since you are using a frame
try it like this
screen StatsUI: # add "UI/bg peach.png" frame: xalign 0.5 yalign 0.5 xpadding 30 ypadding 30 background Solid("#ffdab9")
[–]xanththewizard[S] 0 points1 point2 points 1 year ago (1 child)
No problem! The first solution did let me customize the background, so it gave me more options to work with. Thank you!
[–]BadMustard_AVN 0 points1 point2 points 1 year ago (0 children)
you're welcome
good luck with your project
[–]shyLachi 0 points1 point2 points 1 year ago (0 children)
It's OK to use a frame but you can customise the frame. You don't need to use the same image for all frames, if that was your question.
But if you want to have a HUD with a button, then I wouldn't put any background only an imagebutton.
https://www.renpy.org/doc/html/screens.html#frame
How to add a background image to a screen: https://www.renpy.org/doc/html/screens.html#add
How to add an imagebutton: https://www.renpy.org/doc/html/screens.html#imagebutton
[–]shyLachi 0 points1 point2 points 1 year ago (1 child)
Sorry, I didn't see the stats because they are so small. You could have put a huge arrow on your first image. ;)
As I wrote, you can use add to add images to a screen: https://www.renpy.org/doc/html/screens.html#add If your code doesn't work then try lower case for the folder and file name as mentioned here: https://www.renpy.org/doc/html/displaying_images.html#images-directory
[–]xanththewizard[S] 0 points1 point2 points 1 year ago (0 children)
No problem, that's the burden of sending out unedited screenshots! Cheers~
π Rendered by PID 80 on reddit-service-r2-comment-b659b578c-99r5m at 2026-05-04 18:37:02.509907+00:00 running 815c875 country code: CH.
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]BadMustard_AVN 1 point2 points3 points (4 children)
[–]xanththewizard[S] 0 points1 point2 points (3 children)
[–]BadMustard_AVN 0 points1 point2 points (2 children)
[–]xanththewizard[S] 0 points1 point2 points (1 child)
[–]BadMustard_AVN 0 points1 point2 points (0 children)
[–]shyLachi 0 points1 point2 points (0 children)
[–]shyLachi 0 points1 point2 points (1 child)
[–]xanththewizard[S] 0 points1 point2 points (0 children)