Hotspot. Change variable on hover

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
Ravsii
Newbie
Posts: 2
Joined: Thu May 14, 2015 7:54 am
Contact:

Hotspot. Change variable on hover

#1 Post by Ravsii »

I have a simple imagemap and i need to change my variable when user hover on hotspot. Is it possible at all?
This code doesnt work.

Code: Select all

imagemap:
        ground transparent
        hover transparent
        hotspot ((0, 0, 627, 1080)):
            hovered (bg = "default")

User avatar
Alera
Miko-Class Veteran
Posts: 651
Joined: Sun Mar 21, 2010 3:20 am
Completed: Tortichki // Zayay // Hero's Spirit
Deviantart: psyalera
itch: psyalera
Location: UK
Contact:

Re: Hotspot. Change variable on hover

#2 Post by Alera »

The correct way would be to use SetVariable I think.
http://www.renpy.org/doc/html/screen_actions.html

Code: Select all

SetVariable(variable, value)
Causes variable to be set to value.
Something like that:

Code: Select all

hovered SetVariable('bg', "default")
Image
Games:
❤️ Zayay [Otome?][BxPlayer][NaNo 2013]
❤️ Tortichki [Drag&Drop mini game]

Other games I've worked on:
My Heart's Flame Emissary of Starlight Freedom From Silence Sickness
And many more unannounced/secret projects. (. .)

Ravsii
Newbie
Posts: 2
Joined: Thu May 14, 2015 7:54 am
Contact:

Re: Hotspot. Change variable on hover

#3 Post by Ravsii »

Oh, thanks a lot.

Post Reply

Who is online

Users browsing this forum: Google [Bot]