# ef-canvas

A Component uses to draw graphics on a web page,
it works similarly to the normal HTML5 Canvas element.

## Properties

| Property             | Attribute  | Type                               | Default | Description                                      |
|----------------------|------------|------------------------------------|---------|--------------------------------------------------|
| `autoloop`           | `autoloop` | `boolean`                          | false   | Starts an automatic animation loop.<br />Enabling the frame event. |
| `canvas (readonly)`  |            | `HTMLCanvasElement`                |         | Html canvas element                              |
| `context (readonly)` |            | `CanvasRenderingContext2D \| null` |         | The 2 dimensional context of the canvas, used for drawing |
| `ctx (readonly)`     |            | `CanvasRenderingContext2D \| null` |         | Alias of context                                 |
| `height`             |            | `number`                           | 0       | Height of canvas                                 |
| `width`              |            | `number`                           | 0       | Width of canvas                                  |

## Methods

| Method       | Type                     | Description                                      |
|--------------|--------------------------|--------------------------------------------------|
| `getContext` | `(mode: string): string` | Return context of canvas,<br />support only 2D mode<br /><br />**mode**: mode of canvas's context |

## Events

| Event   | Description                                      |
|---------|--------------------------------------------------|
| `frame` | Fired when next Frame event occurs and autoloop is set to true |
