[SOLVED] Background in game menu

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
lentlen
Newbie
Posts: 13
Joined: Fri Jan 24, 2020 9:27 pm
Completed: Shoot in the head (ru)
Projects: Backerei
Discord: lentlen#1606
Contact:

[SOLVED] Background in game menu

#1 Post by lentlen »

I wanna to change background on settings screen, but it use game menu style that is using game menu background for all game menus like save or load.
if i turn off "use game_menu" then it lose all things like navigation menu and align of all properties but with this i can change backround but ofc i want to do it less painful way but i just can't understand how to do it....PLS HELP T_T
Last edited by lentlen on Thu Aug 05, 2021 8:45 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Background in game menu

#2 Post by Imperf3kt »

In your game_menu screen, adjust it to look for what screen is currently showing.
This is what you should see in a new project

Code: Select all

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background
Adjust that to this:

Code: Select all

    if main_menu:
        add gui.main_menu_background
    elif renpy.get_screen("preferences"):
        add "my image"
    else:
        add gui.game_menu_background
Where "my image" is a file path - example "gui/settings_background.jpg"
or you could do it this way
Somewhere in gui.rpy, paste this

Code: Select all

default gui.settings_menu_background = "gui/settings_background.jpg"
Then make your screen like this:

Code: Select all

    if main_menu:
        add gui.main_menu_background
    elif renpy.get_screen("preferences"):
        add gui.settings_menu_background
    else:
        add gui.game_menu_background
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
lentlen
Newbie
Posts: 13
Joined: Fri Jan 24, 2020 9:27 pm
Completed: Shoot in the head (ru)
Projects: Backerei
Discord: lentlen#1606
Contact:

Re: Background in game menu

#3 Post by lentlen »

wow, i'll try it, it's again easy af or im just too dumb lol.

it was kinda hard but it worked! thanks!

Post Reply

Who is online

Users browsing this forum: No registered users