Unique Hover Options for Hotspots

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Unique Hover Options for Hotspots

#1 Post by Mutive »

Hi all awesome coders (who will hopefully be kind and help me!)

Anyway, I'm fooling around with programming a point and click Renpy game. I've been able to get the hotspots going, but was hoping to have a unique hotspot for each hover. (e.g. if my mouse is on hotspot 1, I'd like to be able to pop up a label that says "Hotspot 1", but if my mouse is on hotspot 2, I'd like one that reads "hotspot 2" without showing the hotspot 1 label.)

I've been able to create something like this in the past by creating a ton of screens, but that seems cumbersome. (Since to do this with some of the graphical assets I'm working with, I'd have to slice them up into small pieces and layer them which would be annoying to say the least.) It also seems possible to do a hover for *all* hotspots from the tutorials I've read. (I haven't made this work so far myself, but I've seen sample code that seems workable. Just, again, this isn't my goal.)

But I'm curious whether it's possible to create hovers for individual hotspots. (I think this would save me a lot of work if so!)

Any help is much appreciated!
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Re: Unique Hover Options for Hotspots

#2 Post by Mutive »

So, I figured it out! First I created a screen for the "unique hover"...

Code: Select all

screen PopUp:
    add "images/PopUp.png" pos (150, 75)
Then I added this line:

Code: Select all

hotspot (70, 80, 120, 1190) clicked Jump ("placetogoto") hovered ShowTransient("PopUp", img="images/PopUp.png") unhovered Hide("PopUp")
So that was easier than feared. ^_^ Life is good!
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

User avatar
Wudgeous
Regular
Posts: 58
Joined: Tue Apr 30, 2019 5:59 am
Tumblr: herotome
itch: wudgeous
Contact:

Re: Unique Hover Options for Hotspots

#3 Post by Wudgeous »

Yay you did it on your own lol. Proud of you! :) I was gonna recommend trying hovered imagebuttons on top of the hotspots, but your solution nicely cuts out the middleman.
Have confidence. Let go of perfectionism. I love you!
Image
A superhero dating sim in fresh hot development!


You can also keep up with me on Twitter and Itch!

Mutive
Veteran
Posts: 344
Joined: Tue Nov 21, 2017 2:23 am
Completed: Eidolon, Minion!, Love Furever, Epilogue
Contact:

Re: Unique Hover Options for Hotspots

#4 Post by Mutive »

Wudgeous wrote: Wed Jan 22, 2020 6:20 am Yay you did it on your own lol. Proud of you! :)
Hah hah, yes! (I usually figure things out literally an hour after posting. Because ~*reasons*~.)
I was gonna recommend trying hovered imagebuttons on top of the hotspots, but your solution nicely cuts out the middleman.
Thanks! I was pretty pleased with the solution as it's really easy to implement! (Which is a good thing since, knowing me, I'll probably layer a ton of buttons in all sorts of peculiar places, so the easier to code the better!)
Enjoy Eidolon, my free to play game at: https://mutive.itch.io/eidolon, Minion! at: https://mutive.itch.io/minion or Epilogue at: https://mutive.itch.io/epilogue

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]