New CG Gallery
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.
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.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
New CG Gallery
http://www.renpy.org/wiki/renpy/doc/coo ... CG_Gallery
I've posted code for a new CG gallery up in the Ren'Py cookbook. This gallery should be as powerful as the one in Ori, Ochi, Onoe, and a bit more flexible.
I've posted code for a new CG gallery up in the Ren'Py cookbook. This gallery should be as powerful as the one in Ori, Ochi, Onoe, and a bit more flexible.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 197
- Joined: Fri Nov 10, 2006 3:25 am
- Location: at a village near Bandung, Indonesia
- Contact:
Riiii~~~ght, finally!
Btw, I do not understand about the Gallery.condition...
Does it apply condition to buttons or image?
Btw, I do not understand about the Gallery.condition...
Does it apply condition to buttons or image?
Kalau tidak suka ya jangan diladeni, gitu aja kok repot™.
Cynanthia's Blog (Indonesian)
Cynanthia's Blog (Indonesian)
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
It can apply to either buttons or images. If you call it immediately after a button, then it applies to that button. If you call it after an image, then it applys to only that image. For example:
This will unlock the secret button, and hence secret1 and secret2, if persistent.secret has been set. secret3 is only unlocked if both persistent.secret and persistent.super_secret have been set.
Code: Select all
g = Gallery()
...
g.page("Secret Stuff")
g.button("thumb_secret.png")
g.condition("persistent.secret")
g.display("secret1.png")
g.display("secret2.png")
g.display("secret3.png")
g.condition("persistent.super_secret")
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 197
- Joined: Fri Nov 10, 2006 3:25 am
- Location: at a village near Bandung, Indonesia
- Contact:
Ara, I see...PyTom wrote:It can apply to either buttons or images. If you call it immediately after a button, then it applies to that button. If you call it after an image, then it applys to only that image. For example:
This will unlock the secret button, and hence secret1 and secret2, if persistent.secret has been set. secret3 is only unlocked if both persistent.secret and persistent.super_secret have been set.Code: Select all
g = Gallery() ... g.page("Secret Stuff") g.button("thumb_secret.png") g.condition("persistent.secret") g.display("secret1.png") g.display("secret2.png") g.display("secret3.png") g.condition("persistent.super_secret")
But...how if we want to apply different condition? (ie. img1 with persistent.end1 and img2 with persistent.end2)
Sorry for asking too much...
Kalau tidak suka ya jangan diladeni, gitu aja kok repot™.
Cynanthia's Blog (Indonesian)
Cynanthia's Blog (Indonesian)
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
You would just apply conditions to those images, and not the button.
Code: Select all
g = Gallery()
...
g.page("Secret Stuff")
g.button("thumb_secret.png")
g.display("secret1.png")
g.condition("persistent.end_1")
g.display("secret2.png")
g.condition("persistent.end_2")
g.display("secret3.png")
g.condition("persistent.end_3")
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 197
- Joined: Fri Nov 10, 2006 3:25 am
- Location: at a village near Bandung, Indonesia
- Contact:
Right, thanks a lot!
Kalau tidak suka ya jangan diladeni, gitu aja kok repot™.
Cynanthia's Blog (Indonesian)
Cynanthia's Blog (Indonesian)
-
- Regular
- Posts: 113
- Joined: Sun Oct 08, 2006 1:29 am
- Location: BEHIND YOU!!!
- Contact:
Just found a bug in the new gallery code; line 125:
Shouldn't idle_border and hover_border be switched?
Otherwise, I love the new gallery code.
Code: Select all
ui.imagebutton(self.gallery.hover_border,
self.gallery.idle_border,
clicked=ui.returns(("button", i)),
**props)
Otherwise, I love the new gallery code.
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Looks like it, thanks. A fixed version has been uploaded.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 160
- Joined: Mon Jan 03, 2005 4:37 am
- Projects: ??????
- Location: In his own little world.
- Contact:
Re: New CG Gallery
What would be the command to call the gallery from an imagebutton?
I tried this:
clicked=_intra_jumps("_gallery", "main_game_transition")
but got an error.
I tried this:
clicked=_intra_jumps("_gallery", "main_game_transition")
but got an error.
-
- Veteran
- Posts: 313
- Joined: Sat Oct 21, 2006 4:18 pm
- Contact:
Re: New CG Gallery
*hugs PyTom*
Everyone needs hugs!
Everyone needs hugs!
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: New CG Gallery
Assuming you're using the code given on the website, it will be:
clicked=_intra_jumps("gallery", "main_game_transition")
without the leading underscore. Note that you define the label containing the gallery code, so you can change that label to anything you want.
clicked=_intra_jumps("gallery", "main_game_transition")
without the leading underscore. Note that you define the label containing the gallery code, so you can change that label to anything you want.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 160
- Joined: Mon Jan 03, 2005 4:37 am
- Projects: ??????
- Location: In his own little world.
- Contact:
Re: New CG Gallery
Another thing, I'm trying to hardcode my own menu buttons for the gallery. I figured out how to add a button to the gallery vbox easy enough, but to get the correct clicked command I can't figure out. Of course it would have to correlate with the gallery pages I make.
So if I have a Character page what would the clicked command be for an imagebutton?
So if I have a Character page what would the clicked command be for an imagebutton?
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: New CG Gallery
It cares about page numbers, rather than page names. To update the navigation, you want to have something like:
Remember, pages are numbered starting from zero, like Turing intended.
Code: Select all
init python:
def gallery_navigation(page_name, page_num, pages):
ui.imagebutton("page0_idle.png", "page0_hover.png", clicked=ui.returns(("page", 0)), xpos=..., ypos=...)
ui.imagebutton("page1_idle.png", "page1_hover.png", clicked=ui.returns(("page", 1)), xpos=..., ypos=...)
ui.imagebutton("page2_idle.png", "page2_hover.png", clicked=ui.returns(("page", 2)), xpos=..., ypos=...)
ui.imagebutton("return_idle.png", "return_hover.png", clicked=ui.returns(("return", 0)), xpos=..., ypos=...)
label gallery:
python hide:
# Construct a new gallery object.
g = Gallery()
g.navigation = gallery_navigation
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 160
- Joined: Mon Jan 03, 2005 4:37 am
- Projects: ??????
- Location: In his own little world.
- Contact:
Re: New CG Gallery
Nice. Got it working. Thank!
I know about starting at 0 from my PHP experience. ^^
I know about starting at 0 from my PHP experience. ^^
Who is online
Users browsing this forum: Google [Bot]