tuning
This commit is contained in:
parent
d80e08f2c9
commit
633c125d51
3 changed files with 20 additions and 3 deletions
5
anim.js
5
anim.js
|
@ -1,11 +1,12 @@
|
||||||
var ease = require('./easing.js').ease
|
var ease = require('./easing.js').ease
|
||||||
var resolution = 30;
|
var resolution = 25;
|
||||||
|
|
||||||
exports.Anim = function(universe) {
|
exports.Anim = function(universe) {
|
||||||
this.universe = universe;
|
this.universe = universe;
|
||||||
this.fx_stack = [];
|
this.fx_stack = [];
|
||||||
this.add = function(to, duration, options) {
|
this.add = function(to, duration, options) {
|
||||||
var options = options || {};
|
var options = options || {};
|
||||||
|
var duration = duration || resolution;
|
||||||
options['easing'] = options['easing'] || 'linear';
|
options['easing'] = options['easing'] || 'linear';
|
||||||
this.fx_stack.push({'to': to, 'duration': duration, 'options': options});
|
this.fx_stack.push({'to': to, 'duration': duration, 'options': options});
|
||||||
return this;
|
return this;
|
||||||
|
|
16
dmx.js
16
dmx.js
|
@ -17,4 +17,20 @@ var x = new A(universe)
|
||||||
.add({1: 255}, 200)
|
.add({1: 255}, 200)
|
||||||
.add({1: 0}, 100)
|
.add({1: 0}, 100)
|
||||||
.add({1: 255}, 100)
|
.add({1: 255}, 100)
|
||||||
|
.add({1: 0})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 255})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 0})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 255})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 0})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 255})
|
||||||
|
.delay(50)
|
||||||
|
.add({1: 0})
|
||||||
|
.run(done);
|
||||||
|
var y = new A(universe)
|
||||||
|
.add({9: 255}, 10000)
|
||||||
.run(done);
|
.run(done);
|
|
@ -49,7 +49,7 @@ exports.init = function(dev_id) {
|
||||||
|
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
send_universe(dev, universe);
|
send_universe(dev, universe);
|
||||||
}, 30);
|
}, 25);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue