Class: RenderingContext2D
Rendering.2D.RenderingContext2D(ctx)
CanvasRenderingContext2D extension
Constructor
new RenderingContext2D(ctx)
Parameters:
Name | Type | Description |
---|---|---|
ctx | CanvasRenderingContext2D |
Methods
clearCanvas()
Clear underlying canvas
drawEllipse(point, radiusX, radiusY, styleopt)
Stroke ellipse with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point | Common.Point | |||
radiusX | float | |||
radiusY | float | |||
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
drawPoint(point, radiusopt, styleopt)
Stroke circle with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point | Common.Point | |||
radius | float | <optional> | 5 | |
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
drawRect(rect, coloropt)
Stroke rect with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rect | Common.Rect | |||
color | Common.Color | <optional> | ColorsBox.GRAY |
drawShape(shape, styleopt)
Stroke shape with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shape | PathBuilding.Path|PathBuilding.Polygon|PathBuilding.PolygonArray | |||
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
fillEllipse(point, radiusX, radiusY, styleopt)
Fill ellipse with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point | Common.Point | |||
radiusX | float | |||
radiusY | float | |||
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
fillPoint(point, radiusopt, styleopt)
Fill circle with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point | Common.Point | |||
radius | float | <optional> | 5 | |
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
fillRect(rect, coloropt)
Fill rect with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rect | Common.Rect | |||
color | Common.Color | <optional> | ColorsBox.GRAY |
fillShape(shape, styleopt)
Fill shape with color
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shape | PathBuilding.Path|PathBuilding.Polygon|PathBuilding.PolygonArray | |||
style | Common.Color|CSSColor|CanvasGradient|CanvasPattern | <optional> | ColorsBox.BLACK |
setTransform(matrix)
Configures rednering transformation over underlying canvas
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix |