FlxSpriteUtil has several drawing functions that can be used to draw onto a FlxSprite.

Use drawLine to draw a line between two points.

FlxSpriteUtil.drawLine(lineSprite, startX, startY, endX, endY, lineStyle);
Note: lineStyle is a `typedef` with several properties that define how your drawn lines are going to look. It is used for all of the drawing functions, and has the following properties:
typedef LineStyle =
 ?thickness:Float,          // Indicates the thickness of the line in points; valid values are 0-255. 0 = hairline
 ?color:FlxColor,           // the color of the line
 ?pixelHinting:Bool,        // When `true`, line widths are adjusted to full pixel widths. With pixelHinting set to false, disjoints can appear for curves and straight lines. 
 ?scaleMode:LineScaleMode,  // Specifies what scale mode to use: NORMAL, NONE, VERTICAL, or HORIZONTAL. Affects how the line is drawn when the object is scaled (scaleX and scaleY).
 ?capsStyle:CapsStyle,      // Specifies the type of caps at the end of lines. Valid values are: NONE, ROUND, and SQUARE
 ?jointStyle:JointStyle,    // Specifies the type of joint appearance used at angles. Valid values are: BEVEL, ROUND, and MITER.
 ?miterLimit:Float          // When jointStyle is set to MITER, this value (1-255) determine how long the miter can extend beyond the point where the lines meet. The default value is 3.



import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.tweens.FlxTween;
import flixel.util.FlxSpriteUtil;

class PlayState extends FlxState
    private var spriteleft:FlxSprite;
    private var spriteright:FlxSprite;
    private var line:FlxSprite;

    override function create()
        line = new FlxSprite();
        line.makeGraphic(FlxG.width, FlxG.height, 0, true);

        spriteleft = new FlxSprite(10, 10, "assets/sprite.png");

        spriteright = new FlxSprite(FlxG.width - 10 - spriteleft.width, FlxG.height - 10 - spriteleft.height, "assets/sprite.png");

        FlxTween.linearMotion(spriteleft, 10, 10, 10, FlxG.height - 10 - spriteleft.height, 2, true, {type: FlxTweenType.PINGPONG});

        FlxTween.linearMotion(spriteright, FlxG.width - 10 - spriteright.width, FlxG.height - 10 - spriteright.height, FlxG.width - 10 - spriteright.width, 10, 2, true, {
            type: FlxTweenType.PINGPONG


    override function update(elapsed:Float):Void

        FlxSpriteUtil.fill(line, 0);

        FlxSpriteUtil.drawLine(line, spriteleft.x + spriteleft.origin.x, spriteleft.y + spriteleft.origin.y, spriteright.x + spriteright.origin.x, spriteright.y + spriteright.origin.y, {
            thickness: 3,
            color: 0xFF00FF00