Beta 8 introduced an issue with Curves.Spline where the path is automatically closed instead of just drawing a stroke between points. It's likely that this impacts other types but I haven't confirmed yet.
Sample code:
const graphics = this.add.graphics(0, 0)
const points = [
new Phaser.Math.Vector2(0, 25),
new Phaser.Math.Vector2(25, 25),
new Phaser.Math.Vector2(75, 50)
];
const curve = new Phaser.Curves.Spline(points);
curve.draw(graphics);
Commit with new stroke function: https://github.com/photonstorm/phaser/commit/8ab00112bfd4f50b4da0e6c909c84136ac49a919#diff-9708b30d47b4f248dbdc749aba89990a
Commit with new implementation: https://github.com/photonstorm/phaser/commit/475091ef41e3ad4bf787830f5de51c12d3af9d87#diff-cd964a16cfe4142fe2c42c67b251321e
I just noticed that the old implementation closes the path _after_ stroking it. I made this change to the new implementation and it had the desired result. I'm not sure if this order of operations change is intended/ needed for other line types, though.
This seems to be fixed in Beta 9?
Actually I can't reproduce it in Beta 8 either.
I can't confirm if this is working with Beta 10 because it looks like something in that release broke static tilemaps.
@iamchristopher - the Tilemap API was (and still is) in flux. Sorry if you were relying on some part of the API, but it will be much more stable as of the next beta.
Regardless, the tilemap is unrelated to your spline issue. I can confirm that this spline issue has been fixed in the latest release (and still is fixed in master).
@mikewesthad I understand that the API is WIP and very much look forward to future improvements and stability. I didn't mean any disrespect with my previous comment; I just meant that my usecase relies on rendering a tilemap (which I realise now isn't noted in the OP) so I couldn't confirm myself.
@iamchristopher no worries! Appreciate the bug report. By the way, you might find it helpful to use the sandbox editor from the examples to quickly test code snippets in isolation.
@mikewesthad Nice, thanks for that! I reference the examples all the time but hadn't come across the sandbox editor before. Would it be possible to note the version being used on the editor (individual examples would be nice as well)?
Good point. I think you can specify a version in the query string when viewing an example (e.g &v=103 to specify the 103.js build from this folder, but I'm not sure that applies to the sandbox editor. Either way, it seems like less of a public feature and more of a development feature. But I think that's a great idea and worth opening up an issue in the phaser3-examples repo if you are up for it.
Absolutely I am! I had no idea about all this functionality in the examples, so thank you very much for that.
Just doing some tidying up and closing this issue off, as it works properly in the current build :) (also, thanks for the examples editor update!)