First thing my apologizes for me English use, is very limitated.
Could someone tell me how I can hide a imagebuton?
I have a simple system for search with mouse objects in the screen.
I use a great code from Alex user here :http://lemmasoft.renai.us/forums/viewto ... f=8&t=6460
But I have no a textbutton, in my case I have a imagebutton. When I call screen for search the picture for the button still there, and I want to know if I can hide the button in someway.
Hope you understand me well, if you don´t I'll try to explain me better with clarifications.
Thank you very much for this awesome page, I never could finish my last project without help from here.
Hide / unhide imagebutton.
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.
Re: Hide / unhide imagebutton.
This was an old style of showing things on screen (overlay functions). This was working like
In modern Ren'Py you should use screens for that
http://www.renpy.org/doc/html/index.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/screens.html#imagebutton
Code: Select all
init:
$ the_thing_button_do = None
$ show_button = False
python:
def my_button():
if show_button:
ui.textbutton("?", clicked=the_thing_button_do, xalign=.95, yalign=.05)
config.overlay_functions.append(my_button)
# The game starts here.
label start:
scene black
"There is no button..."
$ show_button = True
"Here it is!"
$ the_thing_button_do = None
"The button is disabled"
$ the_thing_button_do = (ui.jumps("some_label"))
"Now, it leads to \"some_label\""
$ the_thing_button_do = None
"Disabled again"
$ show_button = False
"... and disappeared..."
jump start
label some_label:
$ the_thing_button_do = None
"This is some_label"
"And button disabled (if not, you could click it and see \"some_label\" once again)"
$ show_button = False
jump start
Code: Select all
screen my_button:
imagebutton:
xalign 0.95 yalign 0.05
idle "idle_img.png"
hover "hover_img.png"
insensitive "insensitive_img.png"
action x
label start:
scene black
"There is no button..."
show screen my_button(x=None)
"Here it is!"
"The button is disabled"
show screen my_button(x=Jump("some_label"))
"Now, it leads to \"some_label\""
show screen my_button(x=None)
"Disabled again"
hide screen my_button
"... and disappeared..."
jump start
label some_label:
show screen my_button(x=None)
"This is some_label"
"And button disabled (if not, you could click it and see \"some_label\" once again)"
hide screen my_button
jump start
http://www.renpy.org/doc/html/index.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/screens.html#imagebutton
Re: Hide / unhide imagebutton.
Work perfect!!
Thank you very much gentleman!!
Thank you very much gentleman!!
Who is online
Users browsing this forum: No registered users