Version
- Phaser Version: 3.90.0, 4.0.0 RC7
Description
Create a new Line Game Object. The width and height are correct, equal to the horizontal and vertical lengths. Call setTo(), changing the endpoint coordinates. The width and height are incorrect (unchanged).
Example Test Code
const line = new Phaser.GameObjects.Line(
{ sys: { queueDepthSort: function () {} } },
0, 0,
0, 0,
1, 2
);
console.info('4 assertions should pass …');
console.assert(line.width === 1, 'Initial width should be 1');
console.assert(line.height === 2, 'Initial height should be 2');
line.setTo(100, 100, 103, 105);
console.assert(line.width === 3, 'Width after setTo() should be 3');
console.assert(line.height === 5, 'Height after setTo() should be 5');
console.info('Done');
Additional Information
Add private updateSize().
Version
Description
Create a new Line Game Object. The
widthandheightare correct, equal to the horizontal and vertical lengths. CallsetTo(), changing the endpoint coordinates. Thewidthandheightare incorrect (unchanged).Example Test Code
Additional Information
Add private
updateSize().