Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

rivella50

Members
  • Posts

    6
  • Joined

  • Last visited

rivella50's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you very much for your answer, Carl. At first i just wanted to make sure if that's the way to go for the desired behaviour. I will do some more tests first, but i would like to come back to you if the results will not get better. Best regards valley
  2. Hi there, for a mobile car game i use Starling and TweenMax for all animations. Since i would like to show a realistic driving behaviour the cars should also be able to brake and accelerate when obstacles occur or vanish. I thought about changing the timeScale property of the car's tween that needs to brake (from 1 to 0) or accelerate again (from 0 to 1) with another Tween. First tests show me that the animated cars with a changed timeScale property do not drive that fluent anymore as with a value of 1.0. What do you think, is this a good and performant approach to implement that behaviour or would there be better options ? Thanks for your opinions. Best regards valley
  3. Ok i found the solution (quite easy): Override the rotation setter in the class to animate: override public function set rotation(value:Number):void { super.rotation = deg2rad(value); } If someone knows the solution about adding a LinePath2D object, i'm still interested
  4. 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
  5. Hi greensock, thank you for your answer. Meanwhile i have added a wrapper around the object to be animated, which solves the problem of having a wrong registration point. Bests valley
  6. Hi there, for a game i use LinePath2D to animate objects over defined paths, where autorotate is enabled. The problem is that the rotation happens around the registration point and this looks very unnatural in my case. Now i tried different ways to change the rotation behaviour to use e.g. the center of the SpriteVisualElement objects as rotation points. For this i have found approaches on the web to rotate an object around another point than the registration point, where they do all work without the use of LinePath2D and TweenMax.to(..), but with them i always run in a Stack overflow error when running the test app. Also i had to override the set rotation() function for the SpriteVisualElement extension class that will animate the objects for being able to change the rotation behaviour, when LinePath2D->renderObjectAt() tries to set the new angle value: override public function set rotation(value:Number):void { rotator.setRegistrationPoint(new Point(this.x + this.width/2, this.y + this.height/2)); rotator.rotation = value; } Using Rotator class (http://code.google.com/p/barteksplaygro ... Rotator.as) is one approach to change the rotation point. Does someone know why i always run into that sort of errors and if yes, how can i solve this problem ? Thanks for any help. Bests valley
×