A drawing interface built on top of h2d.Graphics
.
The h2d.Graphics
class used and its functions are still accessible via the g
parameter.
0.1.0
.Static methods
staticgetDefaultParams():DrawingParams
Returns a new nb.Graphics.DrawingParams
instance with its default values.
Constructor
Variables
Methods
drawBorder(col:Polygon, tile:Tile, ?thickness:Float, tint:Int = 0xFFFFFF, alpha:Float = 1, borderType:BorderType = OUTER, roundAngle:Float = 0.025):BorderData
Draws a border using a given polygon.
Parameters:
col | An array of |
---|---|
tile | An |
thickness | The thickness of the border. |
tint | The tint of the border in the format: |
alpha | The border's alpha value. |
borderType | The type of border to draw. |
roundAngle | An angle in radians for deciding when the corners should be rounded, a threshold.
A negative number means it's always rounded, |
Returns:
The nb.Graphics.BorderData
associated to the border drawn.
drawCircle(cx:Float, cy:Float, radius:Float, nSegments:Int = 0, ?params:Null<DrawingParams>):Graphics
Draws a circle.
drawLine(x1:Float, y1:Float, x2:Float, y2:Float, ?params:Null<DrawingParams>):Graphics
Draws a line.
params.lineDrawMethod
influences the kind of line that will be drawn.
Parameters:
x1 | Starting x coordinate. |
---|---|
y1 | Starting y coordinate. |
x2 | Ending x coordinate. |
y2 | Ending y coordinate. |
params | The drawing parameters. If |
drawLines(points:Array<Point>, ?params:Null<DrawingParams>):Graphics
Draws multiple lines from an array of points.
drawRect(x:Float, y:Float, w:Float, h:Float, ?params:Null<DrawingParams>):Graphics
Draws a rectangle.
vFill(aVertexes:Array<Vertex>, tile:Tile, ?pos:Point, ?dir:Point, draw:Bool = true):Void
Sets the uv parameters of an array of vertexes for a fill operation.
Parameters:
aVertexes | An array of |
---|---|
tile | A tile for defining the fill texture. |
pos | A position where the filling will start. |
dir | A point defining the filling direction. |
draw | Whether this instance's should draw the result. |
vPerimeterFill(aVertexes:Array<Vertex>, tile:Tile, draw:Bool = true, xRepeat:Bool = true, yRepeat:Bool = true, xRepeatOnce:Bool = false, yRepeatOnce:Bool = false):Void
Sets the uv parameters of an array of vertexes for a fill operation.
Parameters:
aVertexes | An array of |
---|---|
tile | A tile for defining the fill texture. |
draw | Whether this instance's should draw the result. |
xRepeat | Whether the fill texture should repeat on the horizontal axis. |
yRepeat | Whether the fill texture should repeat on the vertical axis. |
xRepeatOnce | Whether the fill texture should repeat on the horizontal axis only once. |
yRepeatOnce | Whether the fill texture should repeat on the vertical axis only once. |