Comments (1)
Hi,
segmentGrow
is something I'm not really happy with.
I was looking for a way to animate the drawing of a straight line, so I invented this segmentGrow
thing. What it does is that it takes a target Point
as value, and adds many small segments to the Path
until it reaches said target Point
. It kinda works on small Paths, but it's a huge performance hit if you have many Path
s animated that way.
Anyway you wanted an example, so there you go:
http://jsbin.com/gafaro/1/edit?js,output
var line = new paper.Path();
line.strokeColor = "black";
line.add(new paper.Point(20,20));
line.animate({
properties: {
segmentGrow: new paper.Point(20,100) // target
},
settings: {
duration: 400,
complete: function() {
this.animate({
properties: {
segmentGrow: new paper.Point(30,20) // new target
}
});
}
}
});
Hope this helps.
Cheers
from animatepaper.js.
Related Issues (16)
- Browserify/AMD compatibility HOT 4
- Animate on specific Item' segment HOT 10
- Support animation "loop" HOT 1
- Rotate animation only works once HOT 4
- Animate "rotate" with reference point HOT 3
- animate position strange behavior HOT 6
- Animate "position" with moveOnPath
- easing - is there a list of buildin functions? HOT 4
- [question] Why is it not possible to animate Group fillColor? HOT 4
- add easing-option for CSS-style cubic-bezier curves HOT 1
- allow for absolute negative position values
- repeat for multiple Animation Steps (= repeat Group) [enhancement] HOT 2
- why is 0 as duration not allowed? [question] HOT 1
- How to animate scale when scaleX and scaleY are different? HOT 1
- Use with ffmpegserver.js?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animatepaper.js.