Animation Concepts

3 views
Skip to first unread message

Hicks, Matt

unread,
Jul 21, 2011, 11:23:04 AM7/21/11
to sgin...@googlegroups.com
What do you guys think about the following example of how to asynchronously define animations via a custom DSL:

flow {
    image.position.x and image.position.y moveTo 20 in 5 seconds then image.rotation.y moveTo 1.0 in 1 second then image.position.x and image.position.y moveTo 0 with image.rotation.y moveTo 0.0 in 5 seconds then repeat
}

The flow method would take a function and exposes several implicit conversions to support creation of this animation flow.

Thoughts? Criticism?

-Matt

Landei

unread,
Jul 23, 2011, 5:23:17 AM7/23/11
to sgine-dev
Hi Matt,

I like the idea and would be glad if it could work like that. But DSLs
are tricky, especially to support all cases that make "grammatically"
sense, and to avoid ambiguities. Did you consider using symbols? That
would give you more freedom because of operator precedence and the
"trailing colon rule".

Cheers,
Daniel

On 21 Jul., 17:23, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Hicks, Matt

unread,
Jul 23, 2011, 10:47:57 AM7/23/11
to sgin...@googlegroups.com
Symbols often make for a confusing API up-front.  Though I definitely agree in many places that symbols can be of great benefit I try to remain cautious about using them to avoid increasing the learning curve to use the engine.

The DSL functionality would actually be pretty simple.  It would follow similar convention to that of ScalaTest.

philip

unread,
Jul 25, 2011, 5:30:23 AM7/25/11
to sgine-dev

Hi Matt,

Its clearly a good idea, as long as I can understand the API. As long
as there is simple unit tests I (and others) can look at to understand
it.

Also I'm interested in relationships between objects, like if
something moves into a area, it triggers something else, or hit
testing, cause and effect and events.

Maybe you can look at existing API's that people use to do javascript
animations (JQuery etc) as they try to be more concise lately.

Phil

On Jul 23, 10:47 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

philip

unread,
Jul 25, 2011, 5:34:51 AM7/25/11
to sgine-dev
I mean, think about JQuery animation -

http://api.jquery.com/animate/

It makes use of sort-of functional programming, I'm sure there are
some JQuery plugins which make things work in different ways.

$('#clickme').click(function() {
$('#book').animate({
width: 'toggle',
height: 'toggle'
}, {
duration: 5000,
specialEasing: {
width: 'linear',
height: 'easeOutBounce'
},
complete: function() {
$(this).after('<div>Animation complete.</div>');
}
});
});



On Jul 23, 10:47 pm, "Hicks, Matt" <mhi...@captiveimagination.com>
wrote:

Hicks, Matt

unread,
Jul 27, 2011, 12:55:47 PM7/27/11
to sgin...@googlegroups.com
Yeah, after I get the first iteration completed I definitely want to look at what features others provide to get ideas for making it better.  The cool thing about what I'm creating is that it's extensible via implicits, so you can easily add-on while maintaining the clean DSL functionality.

I checked in some code for this last night, but I've still got a lot of work to do before it's finished.
Reply all
Reply to author
Forward
0 new messages