Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #80 from BlckKnght/motion

Motion tween update
  • Loading branch information...
commit 807481a48286f330be5996642d429d2aa46c3ce0 2 parents 1c70f06 + 243a5aa
@Draknek Draknek authored
Showing with 32 additions and 2 deletions.
  1. +32 −2 net/flashpunk/tweens/motion/Motion.as
View
34 net/flashpunk/tweens/motion/Motion.as
@@ -10,12 +10,38 @@
/**
* Current x position of the Tween.
*/
- public var x:Number = 0;
+ public function get x():Number { return _x; }
+ public function set x(value:Number):void
+ {
+ _x = value;
+ if (_object)
+ _object.x = _x;
+ }
/**
* Current y position of the Tween.
*/
- public var y:Number = 0;
+ public function get y():Number { return _y; }
+ public function set y(value:Number):void
+ {
+ _y = value;
+ if (_object)
+ _object.y = _y;
+ }
+
+ /**
+ * Target object for the tween. Must have an x and a y property.
+ */
+ public function get object():Object { return _object; }
+ public function set object(value:Object):void
+ {
+ _object = value;
+ if (_object)
+ {
+ _object.x = _x;
+ _object.y = _y;
+ }
+ }
/**
* Constructor.
@@ -28,5 +54,9 @@
{
super(duration, type, complete, ease);
}
+
+ protected var _x:Number = 0;
+ protected var _y:Number = 0;
+ protected var _object:Object;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.