Help on Extras/Gallery page

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
bpgc
Newbie
Posts: 3
Joined: Sun Feb 06, 2022 10:10 am
itch: bpgc
Contact:

Help on Extras/Gallery page

#1 Post by bpgc »

I have two questions.

I don't need the images to be unlockable so no problems on that.
Currently, my page looks like this: (lol it's all placeholders)
The red text isn't actually there, though.
Image

1. How do I implement the artist links under the art?

Code: Select all

#textbutton "@ArtistName" action OpenURL("http://artistlink.com") hovered [ Play("sound","audio/click.wav") ] 
2. Most of the art won't be 1920 x 1080, so I want the game_menu background to grey out the other pics when it's zoomed in. How do I code that in?

Sorry these seem like simple questions, I just started learning last month and I can't seem to figure them out. Thanks so much in advance!

my code looks like this:

Code: Select all

init python:
    g = Gallery()


    g.button("red")
    g.image("extras/red.jpg")
   
    g.button("blue")
    g.image("extras/blue.jpg")
  
    g.button("purple")
    g.image("extras/purple.jpg")

    g.button("green")
    g.image("extras/green.jpg")
    
screen extras:
    tag menu

    add "extras/extrasscreen.png"
    hbox:
        ypos 140
        xpos 127

       default curpage = "page1"
       if curpage == "page1":
            grid 3 3:
                xspacing 25
                yspacing 70

                add g.make_button("red","extras/small/red_small.jpg")
                add g.make_button("blue", "extras/small/blue_small.jpg")
                add g.make_button("blue", "extras/small/blue_small.jpg")

                add g.make_button("purple", "extras/small/purple_small.jpg")
                add g.make_button("purple", "extras/small/purple_small.jpg")
                add g.make_button("purple", "extras/small/purple_small.jpg")

                add g.make_button("purple", "extras/small/purple_small.jpg")
                add g.make_button("green_and_orange", "extras/small/green_small.jpg")
                add g.make_button("blue", "extras/small/blue_small.jpg")
        if curpage == "page2":
        	###Insert page 2 here
                
          
    fixed: 
    #Wrong screenshot! Instead of 'Next I just numbered them.
    #these are just placeholders anyway, I'll replace them with imagebuttons to make them look like browser tabs when I get to draw the page.

      textbutton "1" xpos 912 ypos 1012 action SetScreenVariable("curpage", "page1") text_style "extras_button_text"
      textbutton "2" xpos 942 ypos 1012 action SetScreenVariable("curpage", "page2") text_style "extras_button_text"
      textbutton "Return" xpos 1252 ypos 1012 action Return() text_style "extras_button_text"

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]