How to show Image Hover, but not as button (imagemap)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Maxiees
Newbie
Posts: 1
Joined: Wed Dec 19, 2018 2:02 am
Contact:

How to show Image Hover, but not as button (imagemap)

#1 Post by Maxiees »

Hello! I am trying to make a map, where the player put the mouse on a building and it will change the color and show the place's name, but I don't want it work as button, in imagemap function if the player mouse-click it will leave the map, and I don't want it to happen. Someone can help me, please?

Code: Select all

screen Infra:
    
    imagemap:
        ground "InfraGround.png"
        hover "InfraHover.png"
        hotspot (400, 330, 72, 64)  action Return("Warehouse")
        hotspot (467, 419, 64, 32) action Return("Dormitory")
        hotspot (454, 449, 55, 42) action Return("Gym")
        hotspot (496, 511, 60, 48) action Return("My Office")
        hotspot (598, 484, 57, 36) action Return("Refectory")
        hotspot (739, 399, 75, 152) action Return("Logistic Office")
        hotspot (893, 616, 120, 147) action Return("menu")
        
        

User avatar
Chekhov
Regular
Posts: 113
Joined: Tue Jun 26, 2018 9:19 am
Projects: Pluton
Contact:

Re: How to show Image Hover, but not as button (imagemap)

#2 Post by Chekhov »

It's a bit of a dirty workaround, but I find that when I want to make menu-items that don't do anything (besides auxillery functions as being there), I simply give them a "jump (begin-of-menu)" label.

In this case that would be

Code: Select all

jump infra
It depends on a couple of other factors whether that would work in your code and visual effects that may be part of it. So far I haven't made situations where it doesn't work exactly as if it is a button where nothing happens if you press it.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: How to show Image Hover, but not as button (imagemap)

#3 Post by Imperf3kt »

It's better to us action NullAction for that.

...
I could swear I've seen this exact post not long ago.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: No registered users