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
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 »

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: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

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

#2 Post by Andredron »

show your code, I know about 7 ways how to implement the appearance and everything is created differently (there are no telepaths)

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 »

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: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

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

#4 Post by Andredron »

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?

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 »

Ah, no-- how do I do that?

User avatar
Andredron
Miko-Class Veteran
Posts: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

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

#6 Post by Andredron »

run renpy, select the desired project from the left side, then look at "navigating the script", the "clear variables" line will appear,

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 »

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

User avatar
Andredron
Miko-Class Veteran
Posts: 714
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

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

#8 Post by Andredron »

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

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 »

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 »

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")]

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 »

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.


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 »

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 »

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.

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 »

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], Google [Bot]