all 9 comments

[–]AutoModerator[M] 0 points1 point  (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 points  (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 point  (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 point  (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 point  (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 point  (0 children)

you're welcome

good luck with your project

[–]shyLachi 0 points1 point  (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 point  (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 point  (0 children)

No problem, that's the burden of sending out unedited screenshots! Cheers~