bryan at reigndropsfall.net
Mon Apr 24 09:21:29 EDT 2006
First, I'd like to thank everyone for the positive feedback. It's
to hack together an animation library. Ok, enough with the sappy stuff...
> I don't know, seems like what was originally proposed made a lot of
> sense to me. It's at once simple and powerful.
Thanks to suggestions from Tom and Alex, we were able to come up with
all of that powerful syntax.
> You can create an
> animation, you can create a chain of animations, you can create a
> combination of animations. Any one of those operations results in an
> object that can itself be chained/combined/played, or saved for later.
> Looked to me like Bryan kicked butt,
> and I was perfectly happy with that
> concept. I'm not sure how we ended up all going different directions
> (and doubtless triggering Dylan's noise-o-meter =P).
>> > 2. I don't see any reason for new object constructors in order to
> make this work; its just additional overhead when what we'd really want
> is to keep it light and simple.
> There are many ways of skinning this syntactical cat. I really don't
> care if the workers in question are static functions, constructors, or
> methods of animation objects. I just want a unified syntax.
I agree on that. Unified syntax is definitely something that was on my
mind when I attempted this.
> >> anim1.play(); anim2.play(); anim3.play(); ...and let it rest. In
> which case Combine is unnecessary (and I'd be in favor of dropping).
> Unless you want to chain that combination with another. Seems like you
> are tossing out the baby with the bathwater.
Ok, here comes my explanation:
The reason I chose anim1.chain() and dojo.fx.lite.Combine(anim1,
anim2) for the syntax was because with a chain, it connects to the onEnd
signal of the previous animation, so if you want to find out when the
chain ends, you just connect to the onEnd of the last animation passed
in, which making a special object for that seemed a bit much.
The reason for the Combine object is that if you put in two
animations of differing lengths, or even with animations of the same
length, they will end at different times. So Combine fires an onEnd
when all of the animations have completed. Like I said before, I'm a
something like anim1.combine(anim2, anim3) and get the handlers set up
correctly. Maybe, for uniformity's sake, we could just pass back a
Combine from anim1.combine(anim2, anim3).
>> > [Sandro] Also, the meaning of "combine" is not obvious
> Agreed, but IMO the proposed alternatives are not improvements. If we
> can find a better simple verb that's great, otherwise, I think people
> will be able to figure out "combine".
I really don't care what it's called, as long as it makes sense. I
chose combine because I didn't want to copy script.aculo.us's Parallel
and I couldn't think of anything other than Combine. Plus, it starts
with the same letter as Chain ;). I'm not really stuck on Combine, so
if someone comes up with something better, that's cool.
More information about the dojo-contributors