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!
Unique Hover Options for Hotspots
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Unique Hover Options for Hotspots
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
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Re: Unique Hover Options for Hotspots
So, I figured it out! First I created a screen for the "unique hover"...
Then I added this line:
So that was easier than feared. ^_^ Life is good!
Code: Select all
screen PopUp:
add "images/PopUp.png" pos (150, 75)
Code: Select all
hotspot (70, 80, 120, 1190) clicked Jump ("placetogoto") hovered ShowTransient("PopUp", img="images/PopUp.png") unhovered Hide("PopUp")
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
- Wudgeous
- Regular
- Posts: 58
- Joined: Tue Apr 30, 2019 5:59 am
- Tumblr: herotome
- itch: wudgeous
- Contact:
Re: Unique Hover Options for Hotspots
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!
A superhero dating sim in fresh hot development!
You can also keep up with me on Twitter and Itch!
A superhero dating sim in fresh hot development!
You can also keep up with me on Twitter and Itch!
-
- Veteran
- Posts: 344
- Joined: Tue Nov 21, 2017 2:23 am
- Completed: Eidolon, Minion!, Love Furever, Epilogue
- Contact:
Re: Unique Hover Options for Hotspots
Hah hah, yes! (I usually figure things out literally an hour after posting. Because ~*reasons*~.)
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!)I was gonna recommend trying hovered imagebuttons on top of the hotspots, but your solution nicely cuts out the middleman.
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
Who is online
Users browsing this forum: Ahrefs [Bot]