Ren'Py Changing frame

Kakimito

Member
Jan 25, 2022
113
68
hello. can anyone tell me how do I change frame thickness and color? using padding + background color will not work because I use this frame with transparent .png files. literally nothing in the internet about this topic...
 

MidnightArrow

Active Member
Aug 22, 2021
500
451


You create the frame in an image editor. It's not dynamic, it's an image file. The border is defined by what properties you use when creating it.
 

Kakimito

Member
Jan 25, 2022
113
68


You create the frame in an image editor. It's not dynamic, it's an image file. The border is defined by what properties you use when creating it.
hmmm... sounds like a good solution
but how do I add image to Borders()?
 

Kakimito

Member
Jan 25, 2022
113
68
Like the page says, you add the image and the Borders() to a Frame().
I feel like I do smth wrong...
Code:
frame:
        background Frame("Screenshot_2.png", Borders(40, 40, 40, 40))
        text "hello" style "teststyle"
this is my code but with it I get this output (screenshot below)
border image is a simple grey 24x24 picture, font size is 300
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
I feel like I do smth wrong...
Code:
frame:
        background Frame("Screenshot_2.png", Borders(40, 40, 40, 40))
        text "hello" style "teststyle"
this is my code but with it I get this output (screenshot below)
border image is a simple grey 24x24 picture, font size is 300
I can't remember off the top of my head the exact syntax, but I think it needs to be:

Code:
Frame("Screenshot_2.png", Borders(40, 40, 40, 40)):
        text "hello" style "teststyle"
You're not adding it to another frame, you're replacing the frame with a custom one.
 

Kakimito

Member
Jan 25, 2022
113
68
I can't remember off the top of my head the exact syntax, but I think it needs to be:

Code:
Frame("Screenshot_2.png", Borders(40, 40, 40, 40)):
        text "hello" style "teststyle"
You're not adding it to another frame, you're replacing the frame with a custom one.
"'Frame' is not a keyword argument blah, blah, blah"
if I change capital F to small f then error changes to "expected a keyword argument, colon, or end of line"
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
"'Frame' is not a keyword argument blah, blah, blah"
Then I'm not sure. I know you can add it as a custom displayable with "add Frame()" but it won't take children then. Ren'py's screen language may just be hardcoded to use the image in "gui/frame.png", I'm not sure. In that you'll just need to replace the image itself and set the borders in the config file.
 

Kakimito

Member
Jan 25, 2022
113
68
Then I'm not sure. I know you can add it as a custom displayable with "add Frame()" but it won't take children then. Ren'py's screen language may just be hardcoded to use the image in "gui/frame.png", I'm not sure. In that you'll just need to replace the image itself and set the borders in the config file.
the main problem with changing gui stuff is that it will be changed everywhere... but I need it to be changed only here
 

Kakimito

Member
Jan 25, 2022
113
68
Then I'm not sure. I know you can add it as a custom displayable with "add Frame()" but it won't take children then. Ren'py's screen language may just be hardcoded to use the image in "gui/frame.png", I'm not sure. In that you'll just need to replace the image itself and set the borders in the config file.
upd: tried to do
Code:
add Frame("Screenshot_2.png", Borders(4, 4, 4, 4))
but it sill just gives me an upscaled copy of my frame image
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
upd: tried to do
Code:
add Frame("Screenshot_2.png", Borders(4, 4, 4, 4))
but it sill just gives me an upscaled copy of my frame image
Welcome to Ren'py development. It's 1% ideas, 99% trying to decipher shitty documentation for a solution to a simple problem.

Code:
screen TestScreen:

    frame:
        background Frame("custom_frame.png")
        padding (100, 100)
        xfill False
        yfill False

        add "image.png"
I guess the Borders() are useless? This does the exact same thing, except it actually works. So I dunno. The fact that this screen language shit hasn't been scrubbed out and replaced with a competent WYSIWYG visual editor baffles me.

Edit: Turns out the code I posted clips the edges a little bit. But if you use borders and padding, everything seems to work fine:

Code:
    frame:
        background Frame("custom_frame.png", Borders(20, 20, 20, 20))
        padding (20, 20, 20, 20)
        xfill False
        yfill False
        add "image.png"
Even though the documentation says you can pass padding information as part of the Borders(), it doesn't seem to do anything. Only adding the padding info to the frame itself adds padding. So I think it's bugged.
 
Last edited: