Why i can’t read coordinate values of Line Game Objects?
Thanks in Advanced.
I post here 3 examples Test of my code
Test 1
curve = new Phaser.Curves.Line(new Phaser.Math.Vector2(50, 100), new Phaser.Math.Vector2(50, 550));
Results in console window:
curve.x = undefined
curve.y = undefined
curve.x1 = undefined
curve.y1 = undefined
curve.x2 = undefined
curve.y2 = undefined
Test 2
lineHz_1 = new myCurve({scene: this, x:0, y:0, x1:200, y1:125, x2:300, y2:125});
Results in console window:
lineHz_1.x = 0
lineHz_1.x = 0
lineHz_1.x1 = undefined
lineHz_1.y1 = undefined
lineHz_1.x2 = undefined
lineHz_1.y2 = undefined
Test 3
line = this.add.line(0,0, 25, 100, 25, 550, 0x00ff00).setOrigin(0);
Results in console window:
line.x = 0
line.y = 0
line.x1 = undefined
line.y1 = undefined
line.x2 = undefined
line.y2 = undefined