Hi, first post
I’m very confused about how to properly use scene.add.line() as the examples here https://labs.phaser.io/edit.html?src=src/game%20objects/shapes/line.js&v=3.19.0 don’t seem to match up in any way with the docs here https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html#line__anchor note that according to the docs, there are three pairs of x,y in the signature, the second and third pair allegedly form the start and end of the line, but then the first pair is the position…? That doesn’t seem to make any sense, how can you be specifying the start, end, and position at the same time?
In the example it looks like they’re omitting (by setting to zero? how is that differentiated from actually specifying zero?) the second pair in the signature, eg:
this.add.line(200, 200, 0, 0, 140, 0, 0x6666ff);
But the effect of this code seems to be “center the line at 200,200 and make it stretch 140px to the right, which is to say, from 70px to the left of center to 70px to the right of center” are we supposed to do something like specify where it starts from, where it ends, and then manually place it by where the center is? Why is none of this in the docs?
Basically what I’m trying to do is have a line connect two circles (well, scene.add.circle is apparently technically an arc, so two arcs) and then tween the circles around and also tween the ends of the line around. This seems easy enough to do with Phaser.Geom.Line as it has x1,y1,x2,y2 as member variables but Phaser.GameObject.Line has member variables that make very little sense, certainly no x1 and x2. Should I just give up on Phaser.GameObject.Line and draw them manually with graphics and Phaser.Geom.Line or is there some sort of witchcraft I’m missing for tweening a game object line between two points?