eguneys Posted June 13, 2014 Share Posted June 13, 2014 I am trying to animate drawing a line following the method here. http://www.ilike2flash.com/2012/01/animated-line-drawing-using-tweenlite.html I found out that when lineTo method is called to the same position line dissapears. graphic.lineTo(100, 100);graphic.lineTo(100, 100); Take a look at this jsbin. http://jsbin.com/goqaxopu/1/edit?html,js,output Is this intended behaviour or a bug? Quote Link to comment Share on other sites More sharing options...
lewster32 Posted June 17, 2014 Share Posted June 17, 2014 Why would you draw the line to the same position twice concurrently? This would just create a 0 length line at the end of the last line - which I guess is confusing the WebGL line renderer and causing the line to disappear. The problem does not happen if you force pixi to use CanvasRenderer: var renderer = new PIXI.CanvasRenderer(620, 380);I can't think of a valid reason why you'd ever want to call lineTo to the same position twice without at least a moveTo in-between to set a new starting point. Quote Link to comment Share on other sites More sharing options...
eguneys Posted June 17, 2014 Author Share Posted June 17, 2014 I was trying to draw animated line, using tweens sometimes same number gets called twice or very close. Like this: update: function() { graphics.lineTo(animated.X, animated.Y);} I figured it was a wrong approach, since it creates whole bunch of independent lines. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.