Animations
By default animation will play as soon as the paths are created with a default duration of 2000ms
. To change the duration, change the property duration
with a valid number.
Animation will be queued if there are multiple blocks of text. If queuing is not required for any block of text, simply apply the property queued:false
to that text.
If you don’t want the animation to start automatically, set autoAnimation:false
. To start the animation manually call the draw(id)
method inside ready()
. id
, if not provided is the index of the text block.
In order to set delay between animations, set delay
to a valid number.
<div id="vara-container"></div>
var vara = new Vara("#vara-container","SatisfySL.json",[{
text:"Hello World!!",
duration:3000
},{
text:"I am Queued",
},{
text:"I am not Queued",
queued:false
},{
text:"I have a delay.",
delay:2000
}],{
fontSize:46,
strokeWidth:2
});
how can we give x and y positions of the strings to display on screen if we want dynamically
Hi, Check this fiddle https://jsfiddle.net/akzhy/4zjy2b6f/ I first fetches the group which is to be positioned by using the get() method. The container group is then moved using the setPosition(elem,position,relative) method (it is not included in documentation, because it was intended as an internal method), it accepts three arguments, elem – the SVG element object, position – an object with properties x and y to move to and relative – an object with two boolean properties x and y determining whether the element is to be moved from its current position. And finally the width and height of the SVG has… Read more »
i’m using it on ReactJs and get error with message : null of appenchild