How to code a value to increase when moving the mouse

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
HereforM
Newbie
Posts: 1
Joined: Fri Jul 27, 2018 11:21 am
Contact:

How to code a value to increase when moving the mouse

#1 Post by HereforM »

I'm trying to have a value to increase when the mouse is moved over an image while the mouse button is held down, is it possible to code this in renpy? Additionally, how would i have a value increase or decrease over time. Thanks!

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: How to code a value to increase when moving the mouse

#2 Post by Kia »

try:

Code: Select all

default my_variable = 0
screen text:
    button:
        text "test"
        action NullAction()
        hover SetVariable("my_variable", my_variable+1)
I didn't run the code so it might contain errors

Post Reply

Who is online

Users browsing this forum: No registered users