[Solved] Can I hide the ground when mouse is over hover?

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
littleonionbulb
Newbie
Posts: 4
Joined: Fri Jan 15, 2016 12:38 am
Projects: Jin-Pei & Friends
Tumblr: artificial-peach
Contact:

[Solved] Can I hide the ground when mouse is over hover?

#1 Post by littleonionbulb » Wed Jan 27, 2016 5:35 pm

Hello,
I am trying to hide an image whenever the mouse hovers over a hover image.
This is my ground image: (pickydinner.png)
Image

And this is my hover image: (pickyodinner.png)
Image

Here is the code I am using:

Code: Select all

screen pickydinner:
             default a = False
             default b = False
             imagemap:
                ground "pickydinner.png"
                hover "pickyodinner.png" 
                selected_idle "pickyodinner.png" 
                hotspot (561, 113, 126, 94) hovered SetScreenVariable("a", True) unhovered SetScreenVariable("a", False) action [Return("Naesu"), SelectedIf(a) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
                hotspot (492, 158, 159, 167) hovered SetScreenVariable("a", True) unhovered SetScreenVariable("a", False) action [Return("Naesu"), SelectedIf(a) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
                hotspot (160, 164, 104, 209) hovered SetScreenVariable("b", True) unhovered SetScreenVariable("b", False) action [Return("Aules"), SelectedIf(b) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
                hotspot (171, 188, 168, 100) hovered SetScreenVariable("b", True) unhovered SetScreenVariable("b", False) action [Return("Aules"), SelectedIf(b) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
But when the mouse hovers over these hotspots, it looks like this.
Image

Image

I just want the pickydinner.png to be hidden, and I only want the pickyodinner.png to be shown when these hotspots are hovered.
Is this possible in any way?

In advance, i'm so very sorry for the bad explanation. :oops:
Last edited by littleonionbulb on Wed Jan 27, 2016 9:31 pm, edited 1 time in total.

User avatar
xPerfectSuicide
Regular
Posts: 65
Joined: Mon Jun 29, 2015 6:22 am
Completed: InuYame, My little Interview can't be this boring, In the middle of U days
Organization: Luis Design'S
Skype: xPerfectSuicide
Contact:

Re: Can I hide the ground when mouse is over hover

#2 Post by xPerfectSuicide » Wed Jan 27, 2016 7:15 pm

That's because the image has a transparent background, it would be better if instead of using imagemap you use imagebuttons, just like

Code: Select all

imagebutton auto ""pickydinner_%s.png" hovered SetScreenVariable("a", True) unhovered SetScreenVariable("a", False) action [Return("Naesu"), SelectedIf(a) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
Name the files this way pickydinner_idle and pickydinner_hover

User avatar
littleonionbulb
Newbie
Posts: 4
Joined: Fri Jan 15, 2016 12:38 am
Projects: Jin-Pei & Friends
Tumblr: artificial-peach
Contact:

Re: Can I hide the ground when mouse is over hover

#3 Post by littleonionbulb » Wed Jan 27, 2016 8:29 pm

Thank you so much, xPerfectSuicide!
I added a background to the "pickydinner_hover.png", and it works wonderfully :D

Also, I think the code you posted has an extra " after the imagebutton auto.
xPerfectSuicide wrote:

Code: Select all

imagebutton auto ""pickydinner_%s.png" hovered SetScreenVariable("a", True) unhovered SetScreenVariable("a", False) action [Return("Naesu"), SelectedIf(a) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
So instead, should the code be like this without the extra "

Code: Select all

imagebutton auto "pickydinner_%s.png" hovered SetScreenVariable("a", True) unhovered SetScreenVariable("a", False) action [Return("Naesu"), SelectedIf(a) ] activate_sound "chosen.mp3" hover_sound "hover.mp3"
Last edited by littleonionbulb on Thu Jan 28, 2016 1:51 am, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: [Solved] Can I hide the ground when mouse is over hover?

#4 Post by philat » Thu Jan 28, 2016 1:26 am

Since the issue is solved, this is simply to note: since the issue is transparency, I would image that you can solve it either by adding the background to the hover image (as you did) or by having the background image simply be the ground image with the transparent hotspot images for both idle and hover.

Post Reply

Who is online

Users browsing this forum: Ocelot