I want to creat some imagebuttons, which will disappear when clicked. In this way I can simulate collecting inventories.
However, when I clicked one button, the others will blink sometimes, not always.
I really don't know why.
My ren'py version is 7.2.2.491. And I tried old versions, not helping.
The simplified project is in the attachement.
Thank you very much.
Why imagebuttons blinks
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.
Why imagebuttons blinks
- Attachments
-
- Test_buttons.7z
- (612.79 KiB) Downloaded 24 times
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Why imagebuttons blinks
This blinks the image attached to the button. And, it blinks not in a random order, but in the order in which the buttons are written in the screen.
That is, the blinks appears in the button, which is temporarily "in focus".
I don't know if this is a bug or a feature of the screen language.
But there is a solution: create the condition not "above" the buttons, but "inside" them.
That is, to create a condition that the buttons do not actually disappear, but just become inactive and invisible:
https://renpy.org/doc/html/screens.html#if
https://renpy.org/doc/html/screens.html#imagebutton
https://www.renpy.org/doc/html/displayables.html#Null
P.S. But I don't rule out that there's a simpler solution... Maybe (I haven't checked) this effect will not happen when using the imagemap.
https://renpy.org/doc/html/screens.html ... statements
That is, the blinks appears in the button, which is temporarily "in focus".
I don't know if this is a bug or a feature of the screen language.
But there is a solution: create the condition not "above" the buttons, but "inside" them.
That is, to create a condition that the buttons do not actually disappear, but just become inactive and invisible:
Code: Select all
define click = "music/click.wav"
default button1_collected = True
default button2_collected = True
default button3_collected = True
screen buttons_screen:
imagebutton:
pos(500, 300)
idle "images/button1.png"
hover "images/button0.png"
insensitive Null(width=100, height=100)
action If(button1_collected, [Play("sound", click), SetVariable("button1_collected", False)], None)
imagebutton:
pos(1300, 300)
idle "images/button2.png"
hover "images/button0.png"
insensitive Null(width=100, height=100)
action If(button2_collected, [Play("sound", click), SetVariable("button2_collected", False)], None)
imagebutton:
pos(900, 600)
idle "images/button3.png"
hover "images/button0.png"
insensitive Null(width=100, height=100)
action If(button3_collected, [Play("sound", click), SetVariable("button3_collected", False)], None)
label start:
scene black
call screen buttons_screen
return
https://renpy.org/doc/html/screens.html#imagebutton
https://www.renpy.org/doc/html/displayables.html#Null
P.S. But I don't rule out that there's a simpler solution... Maybe (I haven't checked) this effect will not happen when using the imagemap.
https://renpy.org/doc/html/screens.html ... statements
Re: Why imagebuttons blinks
Thank you.
It seems to be a bug of screen language with if statement.
Your solution might be the best way for now.
It seems to be a bug of screen language with if statement.
Your solution might be the best way for now.
Who is online
Users browsing this forum: DewyNebula