How to make an "Extra gallery" 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
yoni_
Newbie
Posts: 9
Joined: Thu May 18, 2017 11:24 pm
Deviantart: nadoChan
Contact:

How to make an "Extra gallery" menu?

#1 Post by yoni_ »

Hello! It's me again~

I wanted to ask how to make an extra menu that will contain (gallery, music room, mini game, character bio, and after ending, so on) I know how to make screens but I don't know how to put a screen in another screen. Like this https://drive.google.com/open?id=0B1d6V ... XQyT1VNNWM

(Yes, I will be using image button not the staggered tempt gui)

Please someone help! I tried everything I could and couldn't find anything!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: How to make an "Extra gallery" menu?

#2 Post by Divona »

You mean as click on one of the imagebutton and then show another screen?

Code: Select all

screen extra():

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

    hbox:
        imagebutton auto "gallery_%s.png" action ShowMenu("gallery")
        imagebutton auto "music_room_%s.png" action ShowMenu("music_room")
        ## And so on...
        . . .

screen gallery():
    tag menu
    . . .

screen music_room():
    tag menu
    . . .
Completed:
Image

User avatar
yoni_
Newbie
Posts: 9
Joined: Thu May 18, 2017 11:24 pm
Deviantart: nadoChan
Contact:

Re: How to make an "Extra gallery" menu?

#3 Post by yoni_ »

Divona wrote:You mean as click on one of the imagebutton and then show another screen?

Code: Select all

screen extra():

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

    hbox:
        imagebutton auto "gallery_%s.png" action ShowMenu("gallery")
        imagebutton auto "music_room_%s.png" action ShowMenu("music_room")
        ## And so on...
        . . .

screen gallery():
    tag menu
    . . .

screen music_room():
    tag menu
    . . .
Thank you! but how do I define the image buttons place?

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: How to make an "Extra gallery" menu?

#4 Post by Divona »

yoni_ wrote:Thank you! but how do I define the image buttons place?
I have no idea what do you mean by "define" here. As in define image to use in imagebutton, or do you asking about the position of the imagebutton?
Completed:
Image

User avatar
yoni_
Newbie
Posts: 9
Joined: Thu May 18, 2017 11:24 pm
Deviantart: nadoChan
Contact:

Re: How to make an "Extra gallery" menu?

#5 Post by yoni_ »

Divona wrote:
yoni_ wrote:Thank you! but how do I define the image buttons place?
I have no idea what do you mean by "define" here. As in define image to use in imagebutton, or do you asking about the position of the imagebutton?
Yep that's what I meant ^^

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: How to make an "Extra gallery" menu?

#6 Post by Divona »

I'm still confused, so I might as well give you both answer...

You can start of by reading about Imagebutton in Ren'Py documentation.

Imagebutton takes both image file and image displayable. So both ways would work fine.

Code: Select all

    imagebutton idle "gallery_idle.png" action ShowMenu("gallery")
Or

Code: Select all

image gallery_button_idle = "gallery_idle.png"

screen extra():
    . . .
    imagebutton idle "gallery_button_idle" action ShowMenu("gallery")
If you read about Imagebutton in Ren'Py documentation, you would notice that this screen object takes:
- Common Properties
- Position Style Properties
- Window Style Properties
- Button Style Properties

So we're looking at Position Style Properties here to place the Imagebutton to where you want on screen. You can choose to use either "xalign and yalign" or "xpos and ypos". So to put this Imagebutton in the middle of the screen, it would be:

Code: Select all

    imagebutton auto "gallery_%s.png" xalign 0.5 yalign 0.5 action ShowMenu("gallery")
Completed:
Image

User avatar
yoni_
Newbie
Posts: 9
Joined: Thu May 18, 2017 11:24 pm
Deviantart: nadoChan
Contact:

Re: How to make an "Extra gallery" menu?

#7 Post by yoni_ »

Divona wrote:I'm still confused, so I might as well give you both answer...

You can start of by reading about Imagebutton in Ren'Py documentation.

Imagebutton takes both image file and image displayable. So both ways would work fine.

Code: Select all

    imagebutton idle "gallery_idle.png" action ShowMenu("gallery")
Or

Code: Select all

image gallery_button_idle = "gallery_idle.png"

screen extra():
    . . .
    imagebutton idle "gallery_button_idle" action ShowMenu("gallery")
If you read about Imagebutton in Ren'Py documentation, you would notice that this screen object takes:
- Common Properties
- Position Style Properties
- Window Style Properties
- Button Style Properties

So we're looking at Position Style Properties here to place the Imagebutton to where you want on screen. You can choose to use either "xalign and yalign" or "xpos and ypos". So to put this Imagebutton in the middle of the screen, it would be:

Code: Select all

    imagebutton auto "gallery_%s.png" xalign 0.5 yalign 0.5 action ShowMenu("gallery")
Thank you so much!! I finally got it to work! I am done with the music room and the gallery~

Post Reply

Who is online

Users browsing this forum: DewyNebula