[Solved] How do you show/hide image on hovered/unhovered, with dissolve, using minimal code?

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
henvu50
Veteran
Posts: 322
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] How do you show/hide image on hovered/unhovered, with dissolve, using minimal code?

#1 Post by henvu50 » Sat Aug 07, 2021 6:05 pm

EDIT: IMO, do not use hovered & unhovered to show anything. Unhovered doesn't always trigger, so whatever you show might remain on screen. Use tooltips instead to show text & displayables.

How do you show/hide image on hovered/unhovered, with dissolve, using minimal code?

Does anything like this exist?

Code: Select all

# PSEUDO CODE
imagebutton:
    hovered ShowImage("some_image.png", Dissolve)
    unhovered HideImage("some_image.png", Dissolve)
The image would get shown at xpos 0, ypos 0 of the entire screen.
Last edited by henvu50 on Wed Aug 11, 2021 11:23 pm, edited 2 times in total.

User avatar
hell_oh_world
Miko-Class Veteran
Posts: 777
Joined: Fri Jul 12, 2019 5:21 am
Projects: The Button Man
Organization: NILA
Github: hell-oh-world
Location: Philippines
Contact:

Re: How do you show/hide image on hovered/unhovered, with dissolve, using minimal code?

#2 Post by hell_oh_world » Sat Aug 07, 2021 7:55 pm

Use a screen and put your image there, and pass the image as an argument.
https://www.renpy.org/doc/html/screen_actions.html#Show

henvu50
Veteran
Posts: 322
Joined: Wed Aug 22, 2018 1:22 am
Contact:

Re: How do you show/hide image on hovered/unhovered, with dissolve, using minimal code?

#3 Post by henvu50 » Sat Aug 07, 2021 10:11 pm

Thanks. That's also the shortest way I've found to show an image. The screen is unavoidable. It's not a problem though, I've turned this custom screen into a nifty image shower with various functionalities.

I just had to ask if that was the most minimalist way to do it.

Post Reply

Who is online

Users browsing this forum: Google [Bot], span4ev