Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
-
vicirl
- Newbie
- Posts: 1
- Joined: Wed Nov 17, 2021 3:10 pm
-
Contact:
#1
Post
by vicirl » Wed Nov 17, 2021 3:23 pm
Hi, I'm so sorry if this is the wrong forum, its about renpy. I'm new to this website and still confused on how to work it.
I'm making a game about reincarnation and I have a few coding questions.
Is there a way to change the characters sprite while hovering over an item? not clicking, hovering. /genq
For example, you hover over an item and the character changes his sprite from happy to upset and says "Please don't touch my things."
If that isn't possible I'll just make it so when you actually click on the item it says that.
Thank you! -vicirl

-
jeffster
- Regular
- Posts: 123
- Joined: Wed Feb 03, 2021 9:55 pm
-
Contact:
#2
Post
by jeffster » Sat Jan 08, 2022 1:44 pm
Hi vicirl,
use forum "Ren'Py Questions and Announcements":
viewforum.php?f=8
Yes, you can. See an example here:
https://patreon.renpy.org/python-tricks-2.html#bgqueue
Basically you put a button or imagebutton on the screen and set its hover action:
Code: Select all
button:
hovered bgq.Enqueue("host angry")
unhovered bgq.Enqueue("host happy")
For a text message that appears on hover, you can set it as a tooltip:
https://www.renpy.org/doc/html/screen_a ... l#tooltips
Or you can use a list of actions on hover (for example, showing some popover screen):
Code: Select all
button:
hovered [
bgq.Enqueue("host angry"),
ShowTransient(overlay_message, some_text="Don't touch it!")
]
screen overlay_message(some_text="Hi!"):
label some_text
Users browsing this forum: No registered users