fabricjs / fabric.js

Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser
http://fabricjs.com
Other
29.01k stars 3.51k forks source link

Object Self Animation..Is it possible? #376

Closed matte00 closed 11 years ago

matte00 commented 11 years ago

Hi all,

thank you for your great job! It's very nice library!

Is possible create animate for fabric's object? I need that every object has a logic behavior, so when change (es. gauges) value the needle automatically go to new position. So i thought a timer for canvas that render all every 30ms, and every object manage its behavior. When property's gauge change it's automatically change its appearance. It's possible?

I tried set timer inside Rect for change fill color at random time but without success. I won't change its fill color from outside.

So, is it possible? I wanted use fabric.js for create an HMI interface for SCADA system. ( Do you think could be better SVG instead of Canvas) ?

I need your help. Thank you so much =)

kangax commented 11 years ago

Yes, object animation is possible via object.animate (http://fabricjs.com/docs/symbols/fabric.Object.html#animate). Please ask questions on google group.