Renpy

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
vicirl
Newbie
Posts: 1
Joined: Wed Nov 17, 2021 3:10 pm
Contact:

Renpy

#1 Post by vicirl »

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 :D

jeffster
Veteran
Posts: 409
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: Renpy

#2 Post by jeffster »

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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]