Question for bad ass problem-solvers: Different bgs in Main_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
alexei
Regular
Posts: 137
Joined: Mon Sep 09, 2019 10:31 am
Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
Organization: Funigami
itch: funigami
Discord: alexei#5190
Contact:

Question for bad ass problem-solvers: Different bgs in Main_Menu

#1 Post by alexei »

hey peeps, question for bad ass problem-solvers:

I have the following main_menu

Image

what I want to do when I click (let's say) the settings, is to default to the bg / screen I have for the game_menu

Image


but right now I get the bg from the Main_Menu

Image

how can I have the desired bg?

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Question for bad ass problem-solvers: Different bgs in Main_Menu

#2 Post by Alex »

Check gui.rpy for this lines

Code: Select all

## Main and Game Menus #########################################################

## The images used for the main and game menus.
define gui.main_menu_background = "gui/main_menu.png"
define gui.game_menu_background = "gui/game_menu.png"
and set game menu bg to desirable image.

There should be this lines in game_menu screen that will use apropriate bg image

Code: Select all

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background

alexei
Regular
Posts: 137
Joined: Mon Sep 09, 2019 10:31 am
Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
Organization: Funigami
itch: funigami
Discord: alexei#5190
Contact:

Re: Question for bad ass problem-solvers: Different bgs in Main_Menu

#3 Post by alexei »

Alex wrote: Thu Sep 16, 2021 7:21 am Check gui.rpy for this lines

Code: Select all

## Main and Game Menus #########################################################

## The images used for the main and game menus.
define gui.main_menu_background = "gui/main_menu.png"
define gui.game_menu_background = "gui/game_menu.png"
and set game menu bg to desirable image.

There should be this lines in game_menu screen that will use apropriate bg image

Code: Select all

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if main_menu:
        add gui.main_menu_background
    else:
        add gui.game_menu_background
that's not what I asked.

alexei
Regular
Posts: 137
Joined: Mon Sep 09, 2019 10:31 am
Completed: re:shape, Monster Boys Doctor, Hearts and Hexes, The Prince's Heart, Dragon Gazer
Projects: Motifs, Longing for Change, The Sinking of the Dream Chaser, Town of the Damned, Monster Boy Wars
Organization: Funigami
itch: funigami
Discord: alexei#5190
Contact:

Re: Question for bad ass problem-solvers: Different bgs in Main_Menu

#4 Post by alexei »

I found the solution.

so, that's what I had to do.

Code: Select all

screen game_menu(title, scroll=None, yinitial=0.0):

    style_prefix "game_menu"

    if renpy.get_screen("main_menu"):
        add gui.main_menu_background
    elif renpy.get_screen('history') or renpy.get_screen('about'):
        add "gui/historybg.png"
    elif renpy.get_screen('preferences'):
        add "gui/settingsbg.png"
    else:
        add gui.game_menu_background

Post Reply

Who is online

Users browsing this forum: Google [Bot]