Line#fromSprite()

fromSprite(startSprite, endSprite, useCenter) → {Phaser.Line}

Sets the line to match the x/y coordinates of the two given sprites.
Can optionally be calculated from their center coordinates.

Parameters
Name Type Argument Default Description
startSprite Phaser.Sprite

The coordinates of this Sprite will be set to the Line.start point.

endSprite Phaser.Sprite

The coordinates of this Sprite will be set to the Line.start point.

useCenter boolean <optional>
false

If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class.

Returns

This line object

Source code: geom/Line.js (Line 63)
doc_phaser
2017-02-14 10:53:58
Comments
Leave a Comment

Please login to continue.