actuate
Version:
Actuate is a flexible, fast "tween" library for animations
85 lines (68 loc) • 2.64 kB
JavaScript
// Class: motion.MotionPath
var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this
$global.Object.defineProperty(exports, "__esModule", {value: true});
var __map_reserved = {};
// Imports
var $hxClasses = require("./../hxClasses_stub").default;
var $import = require("./../import_stub").default;
function motion__$MotionPath_BezierPath() {return require("./../motion/_MotionPath/BezierPath");}
function motion__$MotionPath_BezierSplinePath() {return require("./../motion/_MotionPath/BezierSplinePath");}
function motion__$MotionPath_RotationPath() {return require("./../motion/_MotionPath/RotationPath");}
function motion__$MotionPath_ComponentPath() {return require("./../motion/_MotionPath/ComponentPath");}
// Constructor
var MotionPath = function() {
this._x = new (motion__$MotionPath_ComponentPath().default)();
this._y = new (motion__$MotionPath_ComponentPath().default)();
this._rotation = null;
}
// Meta
MotionPath.__name__ = ["motion","MotionPath"];
MotionPath.__isInterface__ = false;
MotionPath.prototype = {
bezier: function(x,y,controlX,controlY,strength) {
if(strength == null) {
strength = 1;
}
return this.bezierN(x,y,[controlX],[controlY],strength);
},
bezierN: function(x,y,controlX,controlY,strength) {
if(strength == null) {
strength = 1;
}
this._x.addPath(new (motion__$MotionPath_BezierPath().default)(x,controlX,strength));
this._y.addPath(new (motion__$MotionPath_BezierPath().default)(y,controlY,strength));
return this;
},
bezierSpline: function(x,y,strength) {
if(strength == null) {
strength = 1;
}
this._x.addPath(new (motion__$MotionPath_BezierSplinePath().default)(x,strength));
this._y.addPath(new (motion__$MotionPath_BezierSplinePath().default)(y,strength));
return this;
},
line: function(x,y,strength) {
if(strength == null) {
strength = 1;
}
return this.bezierN(x,y,[],[],strength);
},
get_rotation: function() {
if(this._rotation == null) {
this._rotation = new (motion__$MotionPath_RotationPath().default)(this._x,this._y);
}
return this._rotation;
},
get_x: function() {
return this._x;
},
get_y: function() {
return this._y;
}
};
MotionPath.prototype.__class__ = MotionPath.prototype.constructor = $hxClasses["motion.MotionPath"] = MotionPath;
// Init
Object.defineProperties(MotionPath.prototype,{ "rotation" : { get : function () { return this.get_rotation (); }}, "x" : { get : function () { return this.get_x (); }}, "y" : { get : function () { return this.get_y (); }}});
// Statics
// Export
exports.default = MotionPath;