How do I show different buttons on navigate screen on different menus?

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
apoto
Newbie
Posts: 22
Joined: Thu Apr 26, 2018 11:32 am
Contact:

How do I show different buttons on navigate screen on different menus?

#1 Post by apoto »

I'm trying to show different buttons on different menu screens,but I can't make the codes work, please show me a way to fix it or replace it.

Code: Select all

screen evidence():
    tag menu
    predict False
    use game_menu(_("Evidence"), scroll="viewport"):
 
 
        style_prefix "evidence"
use navigation
this is one of the menu screens

Code: Select all

screen navigation():
    if evidence:
        image"evidence_main.png"
    else:
        imagebutton:# evidence
            idle "gui/setting/evidence.png"
            hover "gui/setting/evidence_hover.png"
            xpos 869 ypos 17
            action ShowMenu("evidence")
this is the navigation screen I was planning to make it show different buttons based on the menu screens.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: How do I show different buttons on navigate screen on different menus?

#2 Post by xavimat »

For example:

Code: Select all

screen navigation():
    if renpy.get_screen("evidence"):
        add "evidence_main.png"
    else:
        # ...
Note:
- The statement "image" is used to define images at init time, not inside screens.
- In your example of evidence screen, there is no content to pass to the game_menu screen.
- The line "use navigation" has wrong indentation and shouldn't been included in evidence screen, because it's already present in game_menu screen
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
apoto
Newbie
Posts: 22
Joined: Thu Apr 26, 2018 11:32 am
Contact:

Re: How do I show different buttons on navigate screen on different menus?

#3 Post by apoto »

xavimat wrote: Sat Jul 21, 2018 6:19 pm For example:

Code: Select all

screen navigation():
    if renpy.get_screen("evidence"):
        add "evidence_main.png"
    else:
        # ...
Note:
- The statement "image" is used to define images at init time, not inside screens.
- In your example of evidence screen, there is no content to pass to the game_menu screen.
- The line "use navigation" has wrong indentation and shouldn't been included in evidence screen, because it's already present in game_menu screen
Thank you! It's a great help to me!

Post Reply

Who is online

Users browsing this forum: MisterPinetree, Nozori_Games