Hi I'm trying to figure out how to show objects being appended one by one to a list. Is there a simple way to do this?
For e.g I have five apples which is being appended one by one to some list. But instead of showing a screen of five apples immediately, I want one apple at a time to pop up on the screen as it is being appended. Maybe this very simple below will help visualize what I'm trying to achieve.
(some screen) #X is apple
X
(..0.5 seconds)
XX
(..0.5 seconds)
XXX
(..0.5 seconds)
XXXX
(..0.5 seconds)
XXXXX
(stop)
Thanks beforehand.
[Solved] How to animate items being appended to a list?
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.
[Solved] How to animate items being appended to a list?
Last edited by Deimos96 on Thu Feb 09, 2023 9:58 am, edited 2 times in total.
Re: How to animate items being appended to a list?
Do you mean to show images one by one with some delay based on the content of a list? You can do something like this:
Code: Select all
screen show_images_by_one(image_list):
default total = 1
hbox:
for i in range(0,total):
add image_list[i]
timer 0.5 repeat True action If(total < len(image_list), SetScreenVariable('total', total + 1))
Code: Select all
label start:
show screen show_images_by_one(['apple.png', 'apple.png', 'apple.png', 'apple.png', 'apple.png'])
Re: How to animate items being appended to a list?
Sorry for the late reply. But this works so far. Thank you._ticlock_ wrote: ↑Fri Feb 03, 2023 7:00 pmDo you mean to show images one by one with some delay based on the content of a list? You can do something like this:Code: Select all
screen show_images_by_one(image_list): default total = 1 hbox: for i in range(0,total): add image_list[i] timer 0.5 repeat True action If(total < len(image_list), SetScreenVariable('total', total + 1))
Code: Select all
label start: show screen show_images_by_one(['apple.png', 'apple.png', 'apple.png', 'apple.png', 'apple.png'])
Who is online
Users browsing this forum: No registered users