Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Animation for nodes (Read 3565 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Animation for nodes
Apr 19th, 2013 at 11:49pm
Print Post  
Hi,

Can I apply any sort of animation to nodes? I need to apply blinking animation to a node. Is there any way?

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Animation for nodes
Reply #1 - Apr 22nd, 2013 at 7:53am
Print Post  
Hi,

There is no built-in support for animation. You could use a timer to implement it:

Code
Select All
function onNodeClicked(sender, args)
{
	var node = args.getNode();
	var counter = 0;
	var timerId = setInterval(function ()
	{
		if (node.getStroke() != "red")
		{
			node.setStroke("red");
			node.setStrokeThickness(3);
		}
		else
		{
			node.setStroke(undefined);	// inherit from style
			node.setStrokeThickness(undefined);
		}
		if (counter++ == 5)
			clearInterval(timerId);
	}, 1000);
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Re: Animation for nodes
Reply #2 - Apr 22nd, 2013 at 2:00pm
Print Post  
Thanks Stoyan. Its Great.....
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint