ICanvas.getContext method
ICanvas › getContext
Unofficial
Returns a 2D rendering context.Signature:
getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings | undefined): CanvasRenderingContext2D | nullParameters:
| Parameter | Type | Description |
|---|---|---|
| contextId | "2d" | Context identifier. |
| options? | CanvasRenderingContext2DSettings | undefined | Context attributes. |
Returns: CanvasRenderingContext2D | null — The 2D rendering context, or null.
Unofficial
Returns a WebGL rendering context.Signature:
getContext(contextId: "experimental-webgl" | "webgl", options?: WebGLContextAttributes | undefined): null | WebGLRenderingContextParameters:
| Parameter | Type | Description |
|---|---|---|
| contextId | "experimental-webgl" | "webgl" | Context identifier. |
| options? | WebGLContextAttributes | undefined | Context attributes. |
Returns: null | WebGLRenderingContext — The WebGL rendering context, or null.
Unofficial
Returns a WebGL2 rendering context.Signature:
getContext(contextId: "experimental-webgl2" | "webgl2", options?: WebGLContextAttributes | undefined): null | WebGL2RenderingContextParameters:
| Parameter | Type | Description |
|---|---|---|
| contextId | "experimental-webgl2" | "webgl2" | Context identifier. |
| options? | WebGLContextAttributes | undefined | Context attributes. |
Returns: null | WebGL2RenderingContext — The WebGL2 rendering context, or null.