Can I add layers of images in the 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
User avatar
GeeSeki
Regular
Posts: 112
Joined: Sat Dec 17, 2016 3:39 am
Projects: A Town Uncovered
itch: geeseki
Contact:

Can I add layers of images in the Main Menu?

#1 Post by GeeSeki »

If so, how do I do it? This is the code I have at the moment where it randomly picks a background, but I want to add in a sort of table for the options and maybe other stuff.

Code: Select all

screen main_menu():

    # This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"

    add gui.main_menu_background

    # This empty frame darkens the main menu.
    frame:
        pass

    ## The use statement includes another screen inside this one. The actual
    ## contents of the main menu are in the navigation screen.
    use navigation

    if gui.show_name:

        vbox:
            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"


style main_menu_frame is empty
style main_menu_vbox is vbox
style main_menu_text is gui_text
style main_menu_title is main_menu_text
style main_menu_version is main_menu_text

style main_menu_frame:
    xsize 420
    yfill True

    background renpy.random.choice(["bg atu_school", "bg atu_nightclub", "bg atu_cards"])
    
style main_menu_vbox:
    xalign 1.0
    xoffset -30
    xmaximum 1200
    yalign 1.0
    yoffset -30

style main_menu_text:
    xalign 1.0

    layout "subtitle"
    text_align 1.0
    color gui.accent_color

style main_menu_title:
    size gui.title_text_size

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Can I add layers of images in the Main Menu?

#2 Post by Kia »

try:

Code: Select all

screen main_menu():
    add "images/image1.png"
    add "images/image2.png"
    add "images/image3.png"
    add "images/image4.png"
    ...

User avatar
GeeSeki
Regular
Posts: 112
Joined: Sat Dec 17, 2016 3:39 am
Projects: A Town Uncovered
itch: geeseki
Contact:

Re: Can I add layers of images in the Main Menu?

#3 Post by GeeSeki »

Doesn't work :/ the

Code: Select all

style main_menu_frame:
    xsize 420
    yfill True

    background renpy.random.choice(["bg atu_school", "bg atu_nightclub", "bg atu_cards"])
will just be layered on top of it

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Can I add layers of images in the Main Menu?

#4 Post by Kia »

remove the:

Code: Select all

    background renpy.random.choice(["bg atu_school", "bg atu_nightclub", "bg atu_cards"])
from the main menu screen or move it above the images you add
each line stacks over the line above it

Post Reply

Who is online

Users browsing this forum: piinkpuddiin