Gallery pages

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
Anne
Veteran
Posts: 321
Joined: Mon Apr 01, 2013 8:19 pm
Completed: Fae
Contact:

Gallery pages

#1 Post by Anne »

I'm using the instant gallery code (viewtopic.php?f=51&t=22465), with code like this to go between gallery pages

Code: Select all

textbutton _("1") action [SetVariable('cg_page', 0), ShowMenu("gallery")]
The problem is this way all page buttons are shown as selected. How do I do it so that only the current page is selected?

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: Gallery pages

#2 Post by chocoberrie »

So you want to define a selected state for the text button? Check out the documentation here. What you need to define is a selected_idle state and a selected_hover state.

I've never done this with text buttons before (I like using imagebuttons better because image states are much easier to define with those), so I don't know 100% how the code should be written. The documentation shows styles, but my knowledge of using them correctly is limited. ^^;;

User avatar
Anne
Veteran
Posts: 321
Joined: Mon Apr 01, 2013 8:19 pm
Completed: Fae
Contact:

Re: Gallery pages

#3 Post by Anne »

No, I defined the style alright. The problem is that using the gallery code all the gallery pages buttons are selected, not just the current page I'm on.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Gallery pages

#4 Post by namastaii »

Are you certain it's not something wrong with the image? Like, perhaps you made a selected_idle version of an image your idle image? idle needs to be what it looks like before something is selected or even hovered. Just check and make sure all of that is set up right or even show us the images you have for that then see if it's something wrong in the code.

User avatar
Anne
Veteran
Posts: 321
Joined: Mon Apr 01, 2013 8:19 pm
Completed: Fae
Contact:

Re: Gallery pages

#5 Post by Anne »

I'm not using any images, just textbuttons and it's the same style I use for save/load pages so that's not it.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Gallery pages

#6 Post by namastaii »

ah okay.

Post Reply

Who is online

Users browsing this forum: No registered users