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.
Geckos
Veteran
Posts: 471 Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:
#1
Post
by Geckos » Tue Sep 26, 2017 9:52 am
I'm working on creating an end-game visual map of the branches of my story. I was going to have a small image unlock upon each ending completion. Is there a way to hide an imagebutton until it's been unlocked?
Code: Select all
imagebutton auto "sprites/star/star1_1%s.png" xpos 305 ypos 172 focus_mask None action NullAction() hovered [ Play ("sound", "sfx/cast.ogg"), Show("gui_tooltip", my_picture="ui/changes.png", my_tt_xpos=46, my_tt_ypos=648) ] unhovered [Hide("gui_tooltip")]
RicharDann
Veteran
Posts: 286 Joined: Thu Aug 31, 2017 11:47 am
Contact:
#2
Post
by RicharDann » Tue Sep 26, 2017 10:19 am
Um... an if statement wouldn't work?
Code: Select all
if persistent.ending_1_unlocked:
imagebutton auto "sprites/star/star1_1%s.png" xpos 305 ypos 172 focus_mask None action NullAction() hovered [ Play ("sound", "sfx/cast.ogg"), Show("gui_tooltip", my_picture="ui/changes.png", my_tt_xpos=46, my_tt_ypos=648) ] unhovered [Hide("gui_tooltip")]
The most important step is always the next one.
Geckos
Veteran
Posts: 471 Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:
#3
Post
by Geckos » Tue Sep 26, 2017 4:04 pm
You're right! I wasn't sure of the syntax, as I've never used persistent before and googling around didn't show that order. Thanks so much!
RicharDann wrote: ↑ Tue Sep 26, 2017 10:19 am
Um... an if statement wouldn't work?
Code: Select all
if persistent.ending_1_unlocked:
imagebutton auto "sprites/star/star1_1%s.png" xpos 305 ypos 172 focus_mask None action NullAction() hovered [ Play ("sound", "sfx/cast.ogg"), Show("gui_tooltip", my_picture="ui/changes.png", my_tt_xpos=46, my_tt_ypos=648) ] unhovered [Hide("gui_tooltip")]
[/quote]
Users browsing this forum: No registered users