Hi!
I want to make an on screen loading animation when I click an imagebutton. How do I use the "action" part to do that? I want loading animation to be shown on screen (can be bunch of images too, doesn't matter as long as it's working) then do the Function() parts I provided.
I can show an animation and do the Function but the problem is that I need imagebutton action to run the Function after the animation is done, but they all work at the same time.
Thanks in advance!
[SOLVED] Imagebutton action to show an animation and run a function consecutively
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.
- Wiceramond
- Regular
- Posts: 25
- Joined: Mon Dec 07, 2020 8:40 am
- Contact:
[SOLVED] Imagebutton action to show an animation and run a function consecutively
Last edited by Wiceramond on Mon Mar 06, 2023 12:22 pm, edited 1 time in total.
-
- Veteran
- Posts: 293
- Joined: Fri Sep 17, 2021 2:09 am
- Organization: enaielei
- Tumblr: enaielei
- Deviantart: enaielei
- Github: enaielei
- Skype: enaielei
- Soundcloud: enaielei
- itch: enaielei
- Discord: enaielei#7487
- Contact:
Re: Imagebutton action to show an animation and run a function consecutively
Code: Select all
screen animation(img, time, *actions):
# automatically hides the screen on timer end, if not then just use `action actions`
timer time action (list(actions) + [Hide("animation")])
add img
Code: Select all
# assuming the animation lasts for 12 seconds and the animation was defined using the `image` statement
action Show("animation", None, "your defined animation", 12, Function(...))
- Wiceramond
- Regular
- Posts: 25
- Joined: Mon Dec 07, 2020 8:40 am
- Contact:
Re: Imagebutton action to show an animation and run a function consecutively
Thank you so much, it works like a charm!enaielei wrote: ↑Mon Mar 06, 2023 10:34 amThen in your action...Code: Select all
screen animation(img, time, *actions): # automatically hides the screen on timer end, if not then just use `action actions` timer time action (list(actions) + [Hide("animation")]) add img
Code: Select all
# assuming the animation lasts for 12 seconds and the animation was defined using the `image` statement action Show("animation", None, "your defined animation", 12, Function(...))
Who is online
Users browsing this forum: Ahrefs [Bot], MagicBuns