Complex sequences

  • From: <remy.rakic@gmail.com>
  • To: dev@trident.kenai.com
  • Subject: Complex sequences
  • Date: Thu, 12 Nov 2009 23:22:16 +0000 (GMT)

Hey Kirill :)

Continuing our twitter discussion over a more appropriate channel.

So I believe right now, Timelines and Scenarios are a little 'raw',
they support simple cases very well but I'm not sure how to do complex
cases.

My first use case is this: Let's say I have a default button in a
screen. I have an animation that  emphasizes this button is the default
one, and I want to play it a number of times at specific intervals. The
intervals can be static (at 1.5, 2, and 3s in the scenario - because it
just looks cool that way) or dynamic (calculated in regards to
application state, like the longer this screen has been showing, the
shorter the intervals; or the closer the mouse is to the button the
closer the intervals). It doesn't really matter. I also want to play
the same animation when the mouse rolls over the button. I could do
that by creating as many copies of the same timeline as I wanted to
play, but really I'd want to be able to schedule an animation when I
want it, not duplicate code or memory. I'd want an offset inside a
scenario, and being able to add the same timeline with different
offsets to a scenario if I needed to. The initial delay allows control
over the timing of one timeline inside one scenario, the offset allows
control over the timing of multiple animations (possibly the same one
being added multiple times at different offsets) inside one or more
scenarios (adding the same timeline at different offsets in different
scenarios). It increases the ability to reuse a timeline, because it
decouples the when (offset + initial delay) from the what (the
properties being animated).

Another use case:. I have a complex animation, that effectively
requires multiple timelines in a scenario, that I use to animate items
in a list. (Specifically the animated elements of an item are an image,
a label, some text (which I want to animate line by line), a group of
labels, and finally a group of images. All those are independently
fading in or out and being moved into place or resized). Some of those
are pretty complex already that I'd like to group them into scenarios
but let's say I just manage with one scenario and multiple timelines.
Now I want to animate every item (we can forget about delaying each one
a little because I talked about offsets just before, but in my case
they are each starting at a different time, even though it's the same
scenario. Here the initial delay would work as well). I can create as
many scenarios as the number of items, but how do I play them, do I
iterate over a list of scenarios and call play ? Are they really going
to be synchronized and start at the same time if I have many items ? I
hope so but I can't know for sure. But this is only one animation (one
transition to be exact) not many, I might need to pause this, play it
multiple times or in a loop, what I'd want is only one scenario, one
play() call, and have those scenarios be sub-scenarios to this main
scenario. Once again it increases reusability, of scenarios here,
because it allows them to be composed (+ the gains we saw earlier about
timing).

All in all, API wise this might only be one offset parameter on
Scenario.addTimeline, and Scenario implementing/extending ScenarioActor
?

It's probably more understandable like this than in 140 characters
right ?

What do you think ?
Take care.
Rémy

Complex sequences

remy.rakic 11/12/2009

Re: Complex sequences

Kirill Grouchnikov 11/27/2009

Re: Complex sequences

R?my Rakic 11/27/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20100312.9442df5)
 
 
loading
Please Confirm