Ren'Py Main Page Image Cycling

Xavster

Well-Known Member
Game Developer
Mar 27, 2018
1,243
7,572
The image used on the Ren'Py main page and game menus is defined in your gui settings by the following.
Python:
define gui.main_menu_background = "gui/main_menu.jpg"
define gui.game_menu_background = "gui/game_menu.jpg"
I was wondering if it was possible to have either a random image from a group of images or a slideshow of images to be used instead of just a single image. Not sure whether it is even possible in Ren'Py, however thought it would nice to add some variety.

Note: Have already tried using an image series and a gif file with no success.
 

Zargon_games

Creating Games
Game Developer
Jan 22, 2020
703
3,474
Sure, you need to edit screens.rpy, this is the code of mi game's main menu slideshow :

Code:
## Main Menu screen ############################################################
##
## Used to display the main menu when Ren'Py starts.
##
## https://www.renpy.org/doc/html/screen_special.html#main-menu

init image menu_bg:
    subpixel True
    "gui/mainmenu/1.webp" with dissolve
    zoom 1.0 xalign 0.75 yalign 0.5
    linear 9.5 zoom 1.2 xalign 1 yalign 0.5
    "gui/mainmenu/2.webp" with dissolve
    zoom 1.0 xalign 0.5 yalign 0.5
    linear 9.0 zoom 1.2 xalign 0.25 yalign 0.6
    "gui/mainmenu/3.webp" with dissolve
    zoom 1.0 xalign 0.5 yalign 0.5
    linear 10.0 zoom 1.2 xalign 0.01 yalign 1.0
    "gui/mainmenu/5.webp" with dissolve
    zoom 1.0 xalign 0.75 yalign 0.5
    linear 8.5 zoom 1.2 xalign 1 yalign 0.5
    "gui/mainmenu/6.webp" with dissolve
    zoom 1.0 xalign 0.5 yalign 0.5
    linear 9.5 zoom 1.2 xalign 0.25 yalign 0.2
    "gui/mainmenu/7.webp" with dissolve
    zoom 1.0 xalign 0.5 yalign 0.5
    linear 10.0 zoom 1.5 xalign 0.5 yalign 0.2
    "gui/mainmenu/8.webp" with dissolve
    zoom 1.0 xalign 0.5 yalign 0.5
    linear 9.0 zoom 1.2 xalign 0.7 yalign 0.3
    repeat

screen main_menu():


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

    style_prefix "main_menu"

    add "menu_bg"