Playing an animation when user clicks
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.
-
- Regular
- Posts: 121
- Joined: Thu Aug 12, 2010 11:47 am
- Contact:
Playing an animation when user clicks
I'm trying to find a way for a small animation to play when you click on the screen. For example, if you click in a certain spot, then it shows an explosion animation (non-looping) where the mouse cursor is to let the user know where they clicked. Is there a way to do this in Ren'Py?
Re: Playing an animation when user clicks
The playing-an-explosion-animation part, yes. But IIRC it's not that simple to find the precise location that a user clicked on, in Ren'Py... do you just want a single, predetermined spot where this will happen, or do you want it to happen wherever the user clicks?Glazed Donuts wrote:I'm trying to find a way for a small animation to play when you click on the screen. For example, if you click in a certain spot, then it shows an explosion animation (non-looping) where the mouse cursor is to let the user know where they clicked. Is there a way to do this in Ren'Py?
In general terms, I would set the animation up beforehand using an ATL-defined image, then when you want to show it at X, Y you can do something like:
Code: Select all
$ renpy.show("explosion image name", at_list=[Transform(xpos=X, ypos=Y, xalign=0.5, yalign=0.5)], layer="transient")
$ renpy.pause(1)
$ renpy.hide("explosion image name", layer="transient")
Server error: user 'Jake' not found
Who is online
Users browsing this forum: Google [Bot]