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.
-
Renpie
- Newbie
- Posts: 14
- Joined: Sat Jul 11, 2015 9:49 am
-
Contact:
#1
Post
by Renpie » Sat Jul 18, 2015 6:45 am
Hello,
Is it possible to change some variable if you hover over something?
Lets say "target" is 0 by default and there's 2 pictures on screen. When you hover over picture 1 it changes "target" value to 1, but if you leave picture 1, it stays 1 and only by hovering picture 2 it changes "target" to 2 and visa versa. Is there a way?
I tried mousearea, but it doesn't allow this
Code: Select all
mousearea:
area (5, 295, 175, 50)
hovered Show("buttons_skip")
unhovered Hide("buttons_skip")
action $ target = 1
if this is not possible to do, i have to make so many screens for every single button then..
-
mobychan
- Veteran
- Posts: 275
- Joined: Fri Apr 24, 2015 6:31 am
- Projects: The Chosen - Sakura Pink & Gentian Blue
- Organization: Foresoft
- Location: Germany
-
Contact:
#2
Post
by mobychan » Sat Jul 18, 2015 6:50 am
I guess you're looking for SetVariable?
-
Renpie
- Newbie
- Posts: 14
- Joined: Sat Jul 11, 2015 9:49 am
-
Contact:
#3
Post
by Renpie » Sat Jul 18, 2015 7:06 am
mobychan wrote:I guess you're looking for SetVariable?
It gives error if i try to put that in mousearea.
Code: Select all
File "game/script.rpy", line 34: u'action' is not a keyword argument or valid child for the mousearea statement.
action SetVariable("target", 1)
-
Renpie
- Newbie
- Posts: 14
- Joined: Sat Jul 11, 2015 9:49 am
-
Contact:
#5
Post
by Renpie » Sat Jul 18, 2015 8:32 am
Nice, this does the trick, but for some reason button detection is very slow with mousearea. Most of time i have to pass over the button twice to make it show itself.
Anyway, thanks.
Users browsing this forum: No registered users