Images that Appear on Hover with Imagebuttons don't Disappear...

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
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Images that Appear on Hover with Imagebuttons don't Disappear...

#1 Post by ArizaLuca » Thu Sep 13, 2018 9:32 pm

I have imagebuttons set up so that an image will appear when you hover over the button-- when I click on them, however, the image doesn't go away unless it's the 'Start' button and therefore starting the game-- is there a way to fix that issue?

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#2 Post by Andredron » Fri Sep 14, 2018 5:05 pm

show your code, I know about 7 ways how to implement the appearance and everything is created differently (there are no telepaths)
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#3 Post by ArizaLuca » Fri Sep 14, 2018 5:19 pm

Code: Select all

screen main_menu:
    tag menu 
    
    add "mainmenubganimated" 
    
    $ y=0
    
    imagebutton auto "images/mainmenu_start_%s.png" xpos 0 ypos y focus_mask True action Start() hovered [Show("gui_mainmenu", my_picture="images/mainmenu ri hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff1
    $ y+=50
    if persistent.epilogue == True:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
    else:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover_full.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
    $ y-=50
    imagebutton auto "images/mainmenu_settings_%s.png" xpos -30 ypos y focus_mask True action ShowMenu('preferences') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu gray.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff3
    ##imagebutton auto "images/mainmenu_extras_%s.png" xpos 0 ypos y focus_mask True action Start('extras') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu obsidianassassin hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff4
    $ y-=90
    imagebutton auto "images/mainmenu_quit_%s.png" xpos 0 ypos y focus_mask True action Quit(confirm=True) hovered [ Show("gui_mainmenu", my_picture="images/none.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff5
The main_effs are just animations for when the screen first loads in.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#4 Post by Andredron » Fri Sep 14, 2018 5:29 pm

ArizaLuca wrote:
Fri Sep 14, 2018 5:19 pm

Code: Select all

screen main_menu:
    tag menu 
    
    add "mainmenubganimated" 
    
    $ y=0
    
    imagebutton auto "images/mainmenu_start_%s.png" xpos 0 ypos y focus_mask True action Start() hovered [Show("gui_mainmenu", my_picture="images/mainmenu ri hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff1
    $ y+=50
    if persistent.epilogue == True:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
    else:
        imagebutton auto "images/mainmenu_load_%s.png" xpos 0 ypos y focus_mask True action ShowMenu('load') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu ri_old_hover_full.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff2
    $ y-=50
    imagebutton auto "images/mainmenu_settings_%s.png" xpos -30 ypos y focus_mask True action ShowMenu('preferences') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu gray.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff3
    ##imagebutton auto "images/mainmenu_extras_%s.png" xpos 0 ypos y focus_mask True action Start('extras') hovered [ Show("gui_mainmenu", my_picture="images/mainmenu obsidianassassin hover.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff4
    $ y-=90
    imagebutton auto "images/mainmenu_quit_%s.png" xpos 0 ypos y focus_mask True action Quit(confirm=True) hovered [ Show("gui_mainmenu", my_picture="images/none.png", my_tt_xpos=0, my_tt_ypos=0) ] unhovered [Hide("gui_mainmenu")] at main_eff5
The main_effs are just animations for when the screen first loads in.
your code is like working, have you tried to clear the variables in launcher renpy? since constant variables remember the events and after leaving the game?
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#5 Post by ArizaLuca » Fri Sep 14, 2018 9:42 pm

Ah, no-- how do I do that?

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#6 Post by Andredron » Sat Sep 15, 2018 9:41 am

run renpy, select the desired project from the left side, then look at "navigating the script", the "clear variables" line will appear,
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#7 Post by ArizaLuca » Sat Sep 15, 2018 9:51 am

Ah... I don't see it. I just see Category with files, labels, defines, etc...

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#8 Post by Andredron » Sat Sep 15, 2018 10:05 am

ArizaLuca wrote:
Sat Sep 15, 2018 9:51 am
Ah... I don't see it. I just see Category with files, labels, defines, etc...
My book tutorial open

find this section (You can enter and find this section in the search)

"Ориентирование в главном меню Launcher Ren’Py"

there to translate, build android, change the subject

there, clear the variables you need
I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#9 Post by ArizaLuca » Sat Sep 15, 2018 10:34 am

Er... I don't understand Russian... can you translate it or explain how to do it a different way? I'm sorry.

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#10 Post by DannX » Sat Sep 15, 2018 10:41 am

This is only a guess, I may be wrong but I think when you click a button and show a new screen, the unhovered action is not triggered, so you should also add a Hide() action to your normal clicked action statements.

Code: Select all

# shortened to simplify
imagebutton auto "images/mainmenu_load_%s.png" action [ShowMenu('load'), Hide("gui_mainmenu")]

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#11 Post by ArizaLuca » Sat Sep 15, 2018 10:58 am

DannX wrote:
Sat Sep 15, 2018 10:41 am
This is only a guess, I may be wrong but I think when you click a button and show a new screen, the unhovered action is not triggered, so you should also add a Hide() action to your normal clicked action statements.

Code: Select all

# shortened to simplify
imagebutton auto "images/mainmenu_load_%s.png" action [ShowMenu('load'), Hide("gui_mainmenu")]
Eh... it wasn't incorrect, but it didn't get rid of the issue either.

User avatar
Andredron
Miko-Class Veteran
Posts: 535
Joined: Thu Dec 28, 2017 2:37 pm
Completed: Kimi ga nozomu renpy-port(demo), Albatross Koukairoku(demo)
Projects: Sisters ~Natsu no Saigo no Hi~(renpy-port)
Location: Russia
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#12 Post by Andredron » Sat Sep 15, 2018 11:41 am

I'm writing a Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Help me to register in QQ International

Honest Critique

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#13 Post by ArizaLuca » Sat Sep 15, 2018 11:49 am

Doesn't get rid of the issue either.

DannX
Regular
Posts: 99
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#14 Post by DannX » Sat Sep 15, 2018 12:04 pm

ArizaLuca wrote:
Sat Sep 15, 2018 10:58 am
Eh... it wasn't incorrect, but it didn't get rid of the issue either.
How strange, I managed to replicate the issue but hiding the screen in each button did fix it for me, it could be something in your gui_mainmenu screen, if you can post it too so we can replicate your code as faithfully as possible.

User avatar
ArizaLuca
Veteran
Posts: 241
Joined: Tue Feb 20, 2018 12:59 pm
Completed: Through the Screen, Riddle Me This, Trust Fall, Phobias, Another Adventure
Projects: The Souls in the Seams, Fata Morgana, Minecraft: Story Mode - Behind the Scenes
Organization: Astral Autumn Games
Tumblr: astralautumngames
Deviantart: ArizaLuca
itch: astralautumngames
Contact:

Re: Images that Appear on Hover with Imagebuttons don't Disappear...

#15 Post by ArizaLuca » Sat Sep 15, 2018 12:09 pm

Would this be in the screens file? In that case, I completely eradicated the main menu screen to create this one.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], _ticlock_