I have been learning how to use Ren'Py for about half a week now and have ran into some trouble regarding changing the background of my custom screens...
I am only able to change the background of the main menu and the game menu but not any of the other screens (for example the about, preferences, save/load, history... as well as my own)
More specifically, I have a character screen in my game which will display all of the names of the characters the PC has met. The only thing I am stuck on is changing the background.XD
Could someone PLEASE explain to me how I could change backgrounds of the other screens as well as my own?
Thank you,
Custom screen Change background
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.
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.
-
- Newbie
- Posts: 7
- Joined: Fri Jun 08, 2018 9:00 pm
- Deviantart: kelly00000
- Contact:
Re: Custom screen Change background
To directly change the background of a screen, you need to look at the screen code for that specific screen.
To figure out what you need to do in the future, check out this page first: https://www.renpy.org/doc/html/style_properties.html
Under each heading you'll find different type of style properties you can change, and we can find background under Window Style Properties: https://www.renpy.org/doc/html/style_pr ... properties
As it states, you can use window style properties on windows, frames and buttons, so those are the elements of your screen that you want to change. In this case it's most likely the highest level window of your menu screens.
With background you can specify an image, a colour, a Frame() (stretches with your element) or None.
To apply it you look at your screen code, for example if you're changing the window, you can either put it after the element on the same line, or embed it underneath as a block. Since window and frames are typically blocks already, you may as well put them underneath within the block:
Hope this helps, come back if you need more help on it
To figure out what you need to do in the future, check out this page first: https://www.renpy.org/doc/html/style_properties.html
Under each heading you'll find different type of style properties you can change, and we can find background under Window Style Properties: https://www.renpy.org/doc/html/style_pr ... properties
As it states, you can use window style properties on windows, frames and buttons, so those are the elements of your screen that you want to change. In this case it's most likely the highest level window of your menu screens.
With background you can specify an image, a colour, a Frame() (stretches with your element) or None.
To apply it you look at your screen code, for example if you're changing the window, you can either put it after the element on the same line, or embed it underneath as a block. Since window and frames are typically blocks already, you may as well put them underneath within the block:
Code: Select all
window:
background "images/my_custom_background.png"
# what goes inside your window.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: Custom screen Change background
I'd suggest a more simple approach.
Don't call it "background" call it "how can I add an image in a screen?”. Use "add" to put an image. If the image is the first thing you put in the screen and it fits the entire screen, it does the same function as the background and you don't need to use "window" or styles.
Don't call it "background" call it "how can I add an image in a screen?”. Use "add" to put an image. If the image is the first thing you put in the screen and it fits the entire screen, it does the same function as the background and you don't need to use "window" or styles.
Code: Select all
screen test ():
add "my_background.jpg"
vbox:
# more stuff
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
-
- Newbie
- Posts: 7
- Joined: Fri Jun 08, 2018 9:00 pm
- Deviantart: kelly00000
- Contact:
Re: Custom screen Change background
Thank you both of you that worked!
Have a good day
Have a good day
Who is online
Users browsing this forum: AWizardWithWords, Google [Bot]