Skip to main content

Class: RenderingContext2D

Rendering.2D.RenderingContext2D(ctx)

CanvasRenderingContext2D extension

Constructor

new RenderingContext2D(ctx)

Parameters:
NameTypeDescription
ctxCanvasRenderingContext2D

Methods

clearCanvas()

Clear underlying canvas

drawEllipse(point, radiusX, radiusY, styleopt)

Stroke ellipse with color

Parameters:
NameTypeAttributesDefaultDescription
pointCommon.Point
radiusXfloat
radiusYfloat
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

drawPoint(point, radiusopt, styleopt)

Stroke circle with color

Parameters:
NameTypeAttributesDefaultDescription
pointCommon.Point
radiusfloat<optional>5
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

drawRect(rect, coloropt)

Stroke rect with color

Parameters:
NameTypeAttributesDefaultDescription
rectCommon.Rect
colorCommon.Color<optional>ColorsBox.GRAY

drawShape(shape, styleopt)

Stroke shape with color

Parameters:
NameTypeAttributesDefaultDescription
shapePathBuilding.Path|PathBuilding.Polygon|PathBuilding.PolygonArray
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

fillEllipse(point, radiusX, radiusY, styleopt)

Fill ellipse with color

Parameters:
NameTypeAttributesDefaultDescription
pointCommon.Point
radiusXfloat
radiusYfloat
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

fillPoint(point, radiusopt, styleopt)

Fill circle with color

Parameters:
NameTypeAttributesDefaultDescription
pointCommon.Point
radiusfloat<optional>5
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

fillRect(rect, coloropt)

Fill rect with color

Parameters:
NameTypeAttributesDefaultDescription
rectCommon.Rect
colorCommon.Color<optional>ColorsBox.GRAY

fillShape(shape, styleopt)

Fill shape with color

Parameters:
NameTypeAttributesDefaultDescription
shapePathBuilding.Path|PathBuilding.Polygon|PathBuilding.PolygonArray
styleCommon.Color|CSSColor|CanvasGradient|CanvasPattern<optional>ColorsBox.BLACK

setTransform(matrix)

Configures rednering transformation over underlying canvas

Parameters:
NameTypeDescription
matrixCommon.Matrix

Home