[Solved]Trying to add a navigation in the Gallery CG

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
zabuzaeldemonio
Regular
Posts: 103
Joined: Sun Jan 08, 2017 7:24 pm
Projects: Call Me
Location: Spain
Contact:

[Solved]Trying to add a navigation in the Gallery CG

#1 Post by zabuzaeldemonio »

Hi there, I am trying to add a navigation screen to my Gallery CG, I use the new_gallery.rpy from here, so I really know if that is possible to do. For the people dont know that code I ll let here.

First art.rpy

Code: Select all

init:
    
    # Position the navigation on the right side of the screen.
    $ style.gallery_nav_frame.xpos = 1650 - 10
    $ style.gallery_nav_frame.xanchor = 0.0
    $ style.gallery_nav_frame.ypos = 160

    # Add the gallery to the main menu.
    $ config.main_menu.insert(2, ('Gallery', "gallery", "True"))
# The entry point to the gallery code.

label gallery:
    
    python hide:
        
        # Construct a new gallery object.
        g = Gallery()
        
        # The image used for locked buttons.
        g.locked_button = "images/mini/gallocked.png"

        # The background of a locked image.
        g.locked_background = "gui/file_picker_gallery.jpg"

        # Frames added over unlocked buttons, in hover and idle states.
        g.hover_border = "images/transparente.png"
        g.idle_border = "images/transparente.png"
        


        # An images used as the background of the various gallery pages.
        g.background = "gui/file_picker_gallery.jpg"

        # Lay out the gallery images on the screen.
        # These settings lay images out 3 across and 4 down.
        # The upper left corner of the gird is at xpos 10, ypos 20.
        # They expect button images to be 155x112 in size.
        g.grid_layout((2, 3), (50, 200), (720, 420))
        
        
        # Call make_button to show a particular button.





        # We can use g.page to introduce a second page.
        g.page("{size=-15} {/size}\n{size=+20}   Eileen    {/size}\n{size=-15} {/size}")
        
        
        g.button("images/mini/mini-tercercg.png") # this is the image for a unlocked CG
        g.unlock_image("Beach_club") # this is the image that ll be unlocked you must use the same name for the CG when you define it
        g.unlock_image("Beach_club2") # this is the second image that ll be unlocked in a set of 2 images
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club3")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        g.unlock_image("Beach_club2")
        
        g.page("{size=-15} {/size}\n{size=+20}   People   {/size}\n{size=-15} {/size}")

        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        g.unlock_image("Beach_club2")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        g.unlock_image("Beach_club2")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        
        g.button("images/mini/mini-tercercg.png")
        g.unlock_image("Beach_club")
        

       
        g.show()
    jump main_menu_screen
So I want to try add something like :

Code: Select all

use navigation
there, If someone know how can I do that I would appreciate, Thanks to all
Last edited by zabuzaeldemonio on Wed Jul 17, 2019 1:31 pm, edited 1 time in total.
My personal Project:
Image

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Trying to add a navigation in the Gallery CG

#2 Post by Per K Grok »

zabuzaeldemonio wrote: Tue Jul 16, 2019 9:52 pm Hi there, I am trying to add a navigation screen to my Gallery CG, I use the new_gallery.rpy from here, so I really know if that is possible to do. For the people dont know that code I ll let here.

-----

So I want to try add something like :

Code: Select all

use navigation
there, If someone know how can I do that I would appreciate, Thanks to all
That is not a screen, so you can not include navigation as you do when you include it in another screen.


Try:

show screen navigation


It might not look so good since the screen navigation do not have a background in itself. It is supposed to be used with other screens that do have a background, so you might want to adjust your gallery background with a suitable background area for navigation, or you could make your own screen with a background and use navigation in that screen.

zabuzaeldemonio
Regular
Posts: 103
Joined: Sun Jan 08, 2017 7:24 pm
Projects: Call Me
Location: Spain
Contact:

Re: Trying to add a navigation in the Gallery CG

#3 Post by zabuzaeldemonio »

It worked, thanks!
My personal Project:
Image

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: [Solved]Trying to add a navigation in the Gallery CG

#4 Post by Imperf3kt »

It may not be a screen, but the content is identical, I would place it in a screen and show the screen instead for simplicity.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]