info card for button hover [HELP]

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
User avatar
beastcarving
Regular
Posts: 64
Joined: Mon May 13, 2019 5:03 pm
Completed: Pulse Cage https://beastcarving.itch.io/pulse-cage-the-full-series
Projects: Your Brother's Religion
Organization: BeastCarving Studio
IRC Nick: BeastCarving
Tumblr: beastcarving
Deviantart: beastcarving
Github: beastcarving
itch: beastcarving
Contact:

info card for button hover [HELP]

#1 Post by beastcarving » Wed Sep 11, 2019 5:54 pm

Image
Does anyone know how to add little cards when hovering over a button? I've got some feedback about my menus, and I'd like if an info card could give a definition of each button. For example, this is my load/save menu and those light bulbs are previous and advance buttons. I'd like for the card to say next and previous when hovered over.

Image

this is what my menu looks like now:;

Code: Select all

    imagemap:
        ground "blank.png"
        idle "lb2.png"
        hover "lb1.png"

        cache False
        alpha False


        hotspot (1223,1,175,315) clicked FilePageNext(20)  activate_sound "clack.mp3" hover_sound "clink.mp3"
        hotspot (1,2,202,315) clicked FilePagePrevious(1)  activate_sound "clack.mp3" hover_sound "clink.mp3"


Image Pulse Cage (full game)Image Your Brother's Religion (Demo)
PLAY HERE: https://beastcarving.itch.io/
Love my work: https://www.patreon.com/beastcarving

User avatar
namastaii
Eileen-Class Veteran
Posts: 1299
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life, Coffea Beans
Github: namastaii
Skype: Discord: lunalucid#7684
Soundcloud: deadseed
itch: lunalucid
Location: USA
Contact:

Re: info card for button hover [HELP]

#2 Post by namastaii » Thu Sep 12, 2019 12:02 am

You could add the card art to your imagemap idle image and place the hotspot under an if statement with a null action (action NullAction())
have a screen variable that you change with hovering over the hotspots
something like this? (untested)

Code: Select all

    default next_card = False
    default previous_card = False
    imagemap:
        ground "blank.png"
        idle "lb2.png"
        hover "lb1.png"

        cache False
        alpha False


        hotspot (1223,1,175,315) clicked FilePageNext(20)  hovered SetScreenVariable("next_card", True) unhovered SetScreenVariable("next_card", False) activate_sound "clack.mp3" hover_sound "clink.mp3"
        hotspot (1,2,202,315) clicked FilePagePrevious(1)  hovered SetScreenVariable("previous_card", True) unhovered SetScreenVariable("previous", False)   activate_sound "clack.mp3" hover_sound "clink.mp3"

        if next_card:
            hotspot (the correct hotspots here) action NullAction()
        if previous_card:
            hotspot (etc) action NullAction()
You don't have to put it on your imagemap image directly either, you could also put text or an image/imagebutton under the if statements as well.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]