Layering start menu images? [SOLVED]

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
Harliqueen
Veteran
Posts: 427
Joined: Fri Feb 06, 2015 12:43 pm
Completed: Diving in Deep (NaNo15) The Lady's Choice(NaNo16) The Crossroads(NaNo17)
Projects: The Curse of Creek Edge
Organization: Seraphinite
Tumblr: seraphinitegames
Deviantart: SeraphiniteGames
itch: seraphinite
Contact:

Layering start menu images? [SOLVED]

#1 Post by Harliqueen »

I hope this is the right place to ask this!

I am currently designing the start menu for my VN, and I had an idea I really like, but not entirely sure if it's possible. I searched and searched but can't find anything on it.

What I would like is instead of a CG gallery, every time the player unlocks an ending, that cg shows up on the start main in a particular place on the background. I have managed to do it so as when I unlock an ending it shows up, but the rest won't appear even though I've unlocked them.

Is there a way of having the images show on start screen as they're unlocked, or can only one show up at a time? What I want to achieve I suppose is layering images over the other, as I have transparent backgrounds around them.

I think it's because I'm using the 'add' statement, so it's overwriting the last one. But I'm not even sure how to begin getting it to do what I want :D

I'm still learning RenPy, so any help will be really appreciated! :) This is what I'm currently using, as it's the only thing I could think of.

Should I just scrap this idea, will it not work?

Code: Select all

add "gui/main_menu_ground.jpg"
    
    if persistent.end1_unlocked:
        add "gui/end1.png"
    if persistent.end2_unlocked:
        add "gui/menu_end2.png"
    if persistent.end3_unlocked:
        add "gui/menu_end3.png"
Last edited by Harliqueen on Wed Mar 25, 2015 7:51 pm, edited 1 time in total.
Completed: Diving in Deep/The Lady's Choice/The Crossroads
Current WIP: The Curse of Creek Edge (NaNo2020)

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

Re: Layering start menu images?

#2 Post by Alex »

Check if you have

Code: Select all

persistent.end1_unlocked = False
somewhere in init block that resets the value.

When using persistent variables it should look like

Code: Select all

init:
    if not persistent.end1_unlocked:
        $ persistent.end1_unlocked = False
This code will set persistent variable's value to False only if this variable does not exist yet.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Layering start menu images?

#3 Post by PyTom »

You don't even really need that. Fields on persistent default to None, which is false, so you can just check it and get that falseness until you set it to True.
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

User avatar
Harliqueen
Veteran
Posts: 427
Joined: Fri Feb 06, 2015 12:43 pm
Completed: Diving in Deep (NaNo15) The Lady's Choice(NaNo16) The Crossroads(NaNo17)
Projects: The Curse of Creek Edge
Organization: Seraphinite
Tumblr: seraphinitegames
Deviantart: SeraphiniteGames
itch: seraphinite
Contact:

Re: Layering start menu images?

#4 Post by Harliqueen »

Yay! It's working perfectly! And it looks so cool :D

Thank you so much for your help, I really appreciate it!
Completed: Diving in Deep/The Lady's Choice/The Crossroads
Current WIP: The Curse of Creek Edge (NaNo2020)

Post Reply

Who is online

Users browsing this forum: Google [Bot]