Ren'Py Changing frame

Kakimito

Newbie
Jan 25, 2022
94
61
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

Member
Aug 22, 2021
499
429


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

Newbie
Jan 25, 2022
94
61


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

Newbie
Jan 25, 2022
94
61
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

Member
Aug 22, 2021
499
429
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

Newbie
Jan 25, 2022
94
61
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

Member
Aug 22, 2021
499
429
"'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

Newbie
Jan 25, 2022
94
61
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

Newbie
Jan 25, 2022
94
61
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

Member
Aug 22, 2021
499
429
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: