Hi there,
i'm about to switch to Starling Framework for my new projects.
For a game i animated an object with autorotate=true like this so far (simplified):
points = [new Point(50, 35), new Point(500, 35), new Point(500, 300)];
path = new LinePath2D(points);
var f:PathFollower = path.addFollower(object, 0, true, 90);
tween = TweenMax.to(f, time, {progress: 1, onUpdate:onUpdateTween, ease:Linear.easeNone});
The object started with an initial rotation of 90° to the right and after reaching the 2nd point it
was rotated again by 90° for reaching the final point.
Now with Starling the same approach doesn't work anymore, since there rotations are calculated
using radians. Therefore the rotation at point 2 will not look correctly anymore:
points = [new Point(50, 35), new Point(500, 35), new Point(500, 300)];
path = new LinePath2D(points);
var f:PathFollower = path.addFollower(object, 0, true, deg2rad(90)); // this allows the initial rotation
tween = TweenMax.to(f, time, {progress: 1, onUpdate:onUpdateTween, ease:Linear.easeNone});
Is there a way how rotation can be handled correctly for a Starling Image/Sprite object with Greensock ?
Btw. how can a LinePath2D object be added to a Starling Sprite ? At the moment i get the error "Implicit coercion of a value of type com.greensock.motionPaths:LinePath2D to an unrelated type starling.display:DisplayObject."
Thank you for your help.
Bests
valley