Login Register

animateTransform and curves

Hello,

I´m doing my motion animations to shapes on a dojo.gfx.surface by this code:

dojox.gfx.fx.animateTransform({
					shape : shape,
					duration : (ani.duration * 1000), //ms
					transform: [
				            {name : "translate", start : [ani.fromx, ani.fromy], end:[ani.tox,ani.toy]}
				    ]
					});

but this type of animations are just linear. Now I want to make an animation with a curve. When use something like this:

dojox.gfx.fx.animateTransform({
					shape : shape,
                                        curve: [...],
					duration : (ani.duration * 1000), //ms
					transform: [
				            {name : "translate", start : [ani.fromx, ani.fromy], end:[ani.tox,ani.toy]}
				    ]
					});

... it doesn´t work!

Can anybody tell me how I can add a curve-animation tween to a shape on a surface of dojox.gfx? Thank you!

It looks like each of the

It looks like each of the gfx.fx functions accepts an easing: property, the same as regular _Animations, so you can adjust it accordingly. In Dojo 1.1 the easing package is named dojox.fx.easing, and provides 30 or so easing functions. In 1.2 they will be 'upgraded' to live in dojo.fx.easing, so if you are working from trunk now, that's where you'll find them. (note: dojox.fx.easing was deprecated, so the usage will be transparent until 2.0)

Regards,
Peter Higgins

Hello, I tried out the

Hello,

I tried out the easing-option, but I haven´t come to success. What I want to do is to give the shape on the surface a special tween path. That means something like animatemotion from SVG. In this way you can set the motion tween of the shape with a special path with several coordinates, for example a curve.

At the moment we don't

At the moment we don't support tweens. In the mean time you can try to simulate it with lines, and chain individual pieces together with dojo.fx.chain().

Hello, thank you for your

Hello,

thank you for your help. To simulate the "curve-behavior" by making linear-tweens was the next approach which came to my mind. I gonna try this out.

Greets.