The constructor.
The drawing context.
Draw just an arrow head a the end of an imaginary line (zB) of the given line width the specified (CSS-) color and size.
The start point of the arrow-line.
The end point of the arrow-line.
Any valid CSS color string.
(optional) The line width to use; default is 1.
(optional) The length of the arrow head (default is 8 pixels).
Called before each draw cycle.
Draw a circle with the specified (CSS-) color and radius.
Note that if the x- and y- scales are different the result will be an ellipse rather than a circle.
The center of the circle.
The radius of the circle.
The CSS color to draw the circle with.
(optional) The line width to use; default is 1.
Draw a circular arc (section of a circle) with the given CSS color.
The center of the circle.
The radius of the circle.
The angle to start at.
The angle to end at.
The CSS color to draw the circle with.
Draw a circle handle with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not
distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
as even shaped circles.
The center of the circle.
The CSS color to draw the circle with.
Due to gl compatibility there is a generic 'clear' function required to avoid accessing the context object itself directly.
This function just fills the whole canvas with a single color.
The color to clear with.
Creates a 'shallow' (non deep) copy of this instance. This implies that under the hood the same gl context and gl program will be used.
Draw a cross with diagonal axes with given radius, color and lineWidth at the given position.
Note that the x's radius will not be affected by scaling.
The center of the crosshair.
The radius of the crosshair.
The CSS color to draw the crosshair with.
(optional, default=1.0) The line width to use.
Draw a crosshair with given radius and color at the given position.
Note that the crosshair radius will not be affected by scaling.
The center of the crosshair.
The radius of the crosshair.
The CSS color to draw the crosshair with.
(optional, default=0.5) The line width to use.
Draw the given (cubic) bézier curve.
The start point of the cubic Bézier curve
The end point the cubic Bézier curve.
The start control point the cubic Bézier curve.
The end control point the cubic Bézier curve.
The CSS color to draw the curve with.
(optional) The line width to use; default is 1.
Draw a cubic Bézier curve and and an arrow at the end (endControlPoint) of the given line width the specified (CSS-) color and arrow size.
The start point of the cubic Bézier curve
The end point the cubic Bézier curve.
The start control point the cubic Bézier curve.
The end control point the cubic Bézier curve.
The CSS color to draw the curve with.
(optional) The line width to use.
(optional) The length of the arrow head (default is 8 units).
Draw the given (cubic) Bézier path.
The given path must be an array with n*3+1 vertices, where n is the number of curves in the path:
[ point1, point1_startControl, point2_endControl, point2, point2_startControl, point3_endControl, point3, ... pointN_endControl, pointN ]
The cubic bezier path as described above.
The CSS colot to draw the path with.
(optional) The line width to use; default is 1.
Draw a diamond handle (square rotated by 45°) with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn as even shaped diamonds.
The center of the diamond.
The x/y-size of the diamond.
The CSS color to draw the diamond with.
Draw a 1x1 dot with the specified (CSS-) color.
The position to draw the dot at.
The CSS color to draw the dot with.
Draw an ellipse with the specified (CSS-) color and thw two radii.
The center of the ellipse.
The radius of the ellipse.
The radius of the ellipse.
The CSS color to draw the ellipse with.
(optional) The line width to use; default is 1.
(optional, default=0) The rotation of the ellipse.
Called after each draw cycle.
This is required for compatibility with other draw classes in the library (like drawgl).
Draw a grid of horizontal and vertical lines with the given (CSS-) color.
The center of the grid.
The total width of the grid (width/2 each to the left and to the right).
The total height of the grid (height/2 each to the top and to the bottom).
The horizontal grid size.
The vertical grid size.
The CSS color to draw the grid with.
Draw an image at the given position with the given size.
Note: SVG images may have resizing issues at the moment.Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
The image object to draw.
The position to draw the the upper left corner at.
The x/y-size to draw the image with.
(optional, default=0.0) The transparency (0.0=opaque, 1.0=transparent).
Draw a non-scaling text label at the given position.
The text to draw.
The x-position to draw the text at.
The y-position to draw the text at.
The (aoptional) rotation in radians.
The color to use (default is black).
Draw an SVG-like path given by the specified path data.
An array of path commands and params.
(optional) The color to draw this path with (default is null).
(optional) the line width to use (default is 1).
(optional) If set to true then path transforamtions (scale and translate) will be done in-place in the array. This can boost the performance.
An instance representing the drawn path.
Draw the given point with the specified (CSS-) color and radius 3.
The position to draw the point at.
The CSS color to draw the point with.
Draw a polygon.
The polygon to draw.
The CSS color to draw the polygon with.
Draw a polygon line (alternative function to the polygon).
The polygon vertices to draw.
If true the polyline will not be closed at its end.
The CSS color to draw the polygon with.
(optional) The line width to use; default is 1.
Draw a raster of crosshairs in the given grid.
This works analogue to the grid() function
The center of the raster.
The total width of the raster (width/2 each to the left and to the right).
The total height of the raster (height/2 each to the top and to the bottom).
The horizontal raster size.
The vertical raster size.
The CSS color to draw the raster with.
Draw a rectangle.
The upper left corner of the rectangle.
The width of the rectangle.
The height of the rectangle.
The color to use.
(optional) The line with to use (default is 1).
Set the current drawlib configuration.
The new configuration settings to use for the next render methods.
This method shouled be called each time the currently drawn Drawable
changes.
Determine the class name for further usage here.
A class name for further custom use cases.
This method shouled be called each time the currently drawn Drawable
changes.
It is used by some libraries for identifying elemente on re-renders.
A UID identifying the currently drawn element(s).es.
Draw square at the given center, size and with the specified (CSS-) color.
Note that if the x-scale and the y-scale are different the result will be a rectangle rather than a square.
The center of the square.
The size of the square.
The CSS color to draw the square with.
(optional) The line width to use; default is 1.
Draw a square handle with the given CSS color.
It is an inherent featur of the handle functions that the drawn elements are not scaled and not
distorted. So even if the user zooms in or changes the aspect ratio, the handles will be drawn
as even shaped squares.
The center of the square.
The x/y-size of the square.
The CSS color to draw the square with.
Draw a text at the given relative position.
The text to draw.
The x-position to draw the text at.
The y-position to draw the text at.
The Color to use.
The font family to use.
The font size (in pixels) to use.
The font style to use.
The font weight to use.
The line height (in pixels) to use.
The (optional) rotation in radians.
The text align to use. According to the specifiactions (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textAlign) valid values are "left" || "right" || "center" || "start" || "end"
.
Draw an image at the given position with the given size.
Note: SVG images may have resizing issues at the moment.Draw a line and an arrow at the end (zB) of the given line with the specified (CSS-) color.
The image object to draw.
The texture size to use; these are the original bounds to map the polygon vertices to.
The polygon to use as clip path.
The polygon's position (relative), measured at the bounding box's center.
The rotation to use for the polygon (and for the texture).
Generated using TypeDoc
A wrapper class for basic drawing operations. This is the WebGL implementation whih sould work with shaders.
CubicBzierCurvce
Polygon
SVGSerializable
Vertex
XYCoords