Struct for a drawable 2D line segment, holding endpoint coordinates and corresponding opacity

Constructor

new(_x1:Float, _y1:Float, _x2:Float, _y2:Float)

New line segment from endpoints

Parameters:

_x1

x coorinate of first endpoint

_y1

y coorinate of first endpoint

_x2

x coorinate of second endpoint

_y2

y coorinate of second endpoint

Variables

@:value(1)opacity1:Float = 1

opacity at first endpoint

@:value(1)opacity2:Float = 1

opacity at second endpoint

x1:Float

x coorinate of first endpoint

x2:Float

x coorinate of second endpoint

y1:Float

y coorinate of first endpoint

y2:Float

y coorinate of second endpoint

Methods

flip():Void

Flip direction of the line segment, making the first endpoint the second, and the second the first

setOpacity(o1:Float, o2:Float):Void

Set opacity at each end

Parameters:

o1

opacity at first endpoint

o2

opacity at second endpoint