Hello
Is possible have information (the place where you want to go) in the text box, passing mouse on hotspot before clicking?
Example: (passing mouse on hotspot):"in this place you can swim"
(clicking with the mouse on hotspot): "You picked swimming!"
And similarly, is possible do start an event (always just pointing with the mouse,before clicking for choosing)?
Thanks.
Imagemap (information in text box on hotspot)
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.
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.
-
- Veteran
- Posts: 479
- Joined: Tue Jun 05, 2012 2:01 am
- Contact:
Re: Imagemap (information in text box on hotspot)
http://www.renpy.org/doc/html/screens.html#button . I think you're looking for "hovered" and "unhovered", like so:
(I'm using a button here for simplicity; hotspots in imagemaps support the same thing.)
Code: Select all
screen hovertext:
default infobox = ""
vbox:
textbutton "Foo":
action Return()
hovered SetScreenVariable("infobox", "Foo here")
unhovered SetScreenVariable("infobox", "")
text infobox
Re: Imagemap (information in text box on hotspot)
yes! That's exactly what I was looking ,but on the spot not work,where I wrong?apricotorange wrote:http://www.renpy.org/doc/html/screens.html#button . I think you're looking for "hovered" and "unhovered", like so:
(I'm using a button here for simplicity; hotspots in imagemaps support the same thing.)Code: Select all
screen hovertext: default infobox = "" vbox: textbutton "Foo": action Return() hovered SetScreenVariable("infobox", "Foo here") unhovered SetScreenVariable("infobox", "") text infobox
Code: Select all
screen example_imagemap:
imagemap:
default infobox = ""
ground "Ground.jpg"
hover "Hover.jpg"
hotspot (8, 200, 78, 78) hovered SetScreenVariable("infobox", "swim")clicked Return("swim")
hotspot (204, 50, 78, 78) clicked Return("science")
hotspot (452, 79, 78, 78) clicked Return("art")
hotspot (602, 316, 78, 78) clicked Return("go home")
label example:
call screen example_imagemap
$ result = _return
if result == "swim":
e "You picked swimming!"
elif result == "science":
e "You picked science!"
elif result == "art":
e "You picked art!"
elif result == "go home":
e "You went home!"
return
-
- Veteran
- Posts: 479
- Joined: Tue Jun 05, 2012 2:01 am
- Contact:
Re: Imagemap (information in text box on hotspot)
You need a line like "text infobox" to actually show the text; setting the variable does nothing by itself.
Re: Imagemap (information in text box on hotspot)
Yes, my bad...apricotorange wrote:You need a line like "text infobox" to actually show the text; setting the variable does nothing by itself.
Now it works really well, thank you very much for help!
(This is solved for me)
Who is online
Users browsing this forum: Google [Bot]