You probably want to rotate that fidgetspinner...
Heheh, it's more complex than that: a frame-by-frame animation of a person fidgeting (and it uses more than 5 frames, but I was just trying to simplify the problem). Suffice to say, I'm afraid ATL transforms aren't gonna cut it.
or just do it inside a screen *i think*
Code: Select all
transform Fidget(anim_speed=0.04):
"fidget1.jpg"
pause anim_speed
"fidget2.jpg"
pause anim_speed
"fidget3.jpg"
pause anim_speed
"fidget4.jpg"
pause anim_speed
"fidget5.jpg"
pause anim_speed
repeat
screen something():
add Fidget(anim_speed)
label start:
show screen something
pause
not tried, but it should work.
I tried this one, but changing anim_speed still resets the animation. Also, there was a bizarre framerate effect where it would initially play slowly, then jump quickly, then loop at the right pace. This would only happen on the first loop, I assume because it's loading things into memory?
as gas said use a function so should be something like this...
Code: Select all
init python:
def var_speed(trans, st, at):
trans.set_child("fidget{}.jpg".format(store.frame_num))
store.frame_num += 1
if store.frame_num > 5: # 5 since in your example you only have 5 frames for the animation.
store.frame_num = 1
return store.anim_speed
default frame_num = 1
default anim_speed = 0.04
image Fidget:
function var_speed
This, however, works!
Though one thing that concerns me a little: It plays more slowly than the original version, and this difference is very noticeable (almost double speed) at 0.02 for both of them. Then it catches back up again at 0.01, and the difference is also negligible at 0.1 or greater.
This doesn't matter at all UNLESS it's something a higher-end computer would fix? Because that would mean the animation could play at significantly different rates on different machines.
Anyway, I'll try to test it on different devices. No matter what, thank you both!!