Main Menu Background

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
clannadman

Main Menu Background

#1 Post by clannadman »

I've been configuring the main menu and setting things recently and wondered whether it's at all possible to have a slide show playing as the background of the main menu? I don't know whether this could be achieved with a splashscreen or something. I'm using renpy and jedit.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Main Menu Background

#2 Post by PyTom »

It's actually pretty easy for a two step process. First, set up a slideshow using an ATL image:

Code: Select all

image slideshow:
    "image1.jpg" with dissolve
    pause 3.0
    "image2.jpg" with dissolve
    pause 3.0
    "image3.jpg" with dissolve
    pause 3.0
    repeat
Then, set the background to be the slideshow image.

Code: Select all

init python:
    style.mm_root.background = "slideshow"
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

clannadman

Re: Main Menu Background

#3 Post by clannadman »

I get an error regarding the repeat function:
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


On line 62 of expected statement.
repeat
^

Ren'Py Version: Ren'Py 6.11.2b
Any ideas?

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Main Menu Background

#4 Post by PyTom »

It seems like you didn't indent repeat properly. Can you post your script?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

clannadman

Re: Main Menu Background

#5 Post by clannadman »

On my script:

Code: Select all

    image slideshow:
    "splash2.jpg" with dissolve
    pause 3.0
    "splash3.jpg" with dissolve
    pause 3.0
    "splash4.jpg" with dissolve
    pause 3.0
    repeat
Then on my options:

Code: Select all

style.mm_root.background = "slideshow"
As well as the slideshow, I've used an image map png so that the slideshow can be seen behind it (hopefully):

Code: Select all

init -2 python:
    layout.imagemap_main_menu("menutransmain.png", "menutrans.png", [
        (417, 210, 541 ,240, "Start Game"),
        (417, 247, 543, 269, "Load Game"),
        (420, 282, 542, 307, "Preferences"),
        (455, 354, 507, 383, "Quit"),
        (455, 317, 507, 346, "Help"),
        ])

clannadman

Re: Main Menu Background

#6 Post by clannadman »

Any suggestions how this can be achieved or what's going wrong? Whether I'm pasting it in the wrong place?

Verity
Regular
Posts: 67
Joined: Wed Jul 30, 2008 11:43 am
Projects: Wanderer
Location: USA
Contact:

Re: Main Menu Background

#7 Post by Verity »

Is the first block of code you posted in your last post indented the way it is there? If so, you might have to drop the first line back four spaces for it to work properly. Python (and by extension Renpy) is very dependent on whitespace use, so that can muck things up if you're not careful.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Ocelot