farzher Posted April 30, 2014 Share Posted April 30, 2014 I have one of these things@pathGraphic = @add.graphics 0, 0And I drew lines on it@pathGraphic.lineStyle 1, 0xddd000, [email protected] 2, [email protected] 22, 55I need to clear it out and draw new lines on it. How do I do that? I don't want to delete it and create a new one, that's probably a waste of memory. Am I using the right thing to be drawing lines?Most of the methods I'm using aren't even in the documentation for Graphics http://docs.phaser.io/Phaser.Graphics.htmlWhy is that? (Sorry for the code not being Javascript, but I think you get the point) Link to comment Share on other sites More sharing options...
turnA Posted April 30, 2014 Share Posted April 30, 2014 I think that's correct. The method to clear the graphic is: @pathGraphic.clear() I think the docs not updated yet? Link to comment Share on other sites More sharing options...
farzher Posted April 30, 2014 Author Share Posted April 30, 2014 Works well, ty. It would be great if the docs were up to date. Then I wouldn't have to spam the forums!I actually even console.log'd my instance of Phaser.Graphic (pathGraphic) and it didn't have a clear method on it. I'm not sure how that's possible, but it works. Link to comment Share on other sites More sharing options...
Recommended Posts