That works for the progress bar. Im basically chaining two animations together, one for the progress bar growing, and the other for it pausing. Three’s 2 problems now:
- The duration of the grow and pause states are the same, there’s no way to make them different. So if I wanted to grow the bar for 10 seconds and pause for 5, I don’t see a way to do that presently…
- I still need to show the answer once the bar is done growing. I tried a bunch of stuff with other fake animations and sequences but couldn’t seem to get it to work…
Here’s my current code:
load("render.star", "render")
load("math.star", "math")
PROGRESS_BAR_COLOR = "#f00"
PROGRESS_BAR_HEIGHT = 2
PROGRESS_BAR_DURATION = 10 #seconds
SHOW_ANSWER_DURATION = 10 #seconds
def main(config):
return render.Root(
delay=math.floor((PROGRESS_BAR_DURATION*1000) / 65), # delay is ms/frame
show_full_animation=True,
child = render.Column(
expanded=True,
main_align="space_between",
children = [
render.Sequence(
children = [
render.Animation(
children = [
render.Box(width=0, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=1, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=2, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=3, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=4, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=5, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=6, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=7, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=8, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=9, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=10, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=11, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=12, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=13, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=14, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=15, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=16, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=17, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=18, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=19, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=20, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=21, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=22, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=23, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=24, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=25, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=26, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=27, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=28, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=29, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=30, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=31, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=32, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=33, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=34, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=35, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=36, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=37, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=38, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=39, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=40, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=41, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=42, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=43, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=44, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=45, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=46, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=47, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=48, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=49, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=50, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=51, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=52, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=53, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=54, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=55, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=56, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=57, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=58, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=59, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=60, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=61, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=62, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=63, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
]
),
render.Animation(
children = [
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
render.Box(width=64, height=PROGRESS_BAR_HEIGHT, color=PROGRESS_BAR_COLOR),
]
),
]
),
render.WrappedText(content="What is the capital of California?", font="tom-thumb"),
render.Marquee(
width=64,
align="center",
child = render.Text(content="Sacramento", font="tom-thumb")
),
]
)
)
BTW Thanks so much for your input so far, I think I have a little better understanding how these things integrate, even if I haven’t found a complete solution yet.