components/AnimationCanvas
Interfaces
AbsoluteSizingProps
Defined in: components/AnimationCanvas/index.tsx:56
Properties
height?
optional height?: number;
Defined in: components/AnimationCanvas/index.tsx:58
width?
optional width?: number;
Defined in: components/AnimationCanvas/index.tsx:57
CommonProps
Defined in: components/AnimationCanvas/index.tsx:46
Properties
animate?
optional animate?: boolean;
Defined in: components/AnimationCanvas/index.tsx:49
draw
draw: DrawFunction;
Defined in: components/AnimationCanvas/index.tsx:47
init?
optional init?: InitFunction;
Defined in: components/AnimationCanvas/index.tsx:48
options?
optional options?: CanvasRenderingContext2DSettings;
Defined in: components/AnimationCanvas/index.tsx:53
See
https://developer.mozilla.org/docs/Web/API/HTMLCanvasElement/getContext#contextattributes
RelativeSizingProps
Defined in: components/AnimationCanvas/index.tsx:61
Properties
reduceFlickering?
optional reduceFlickering?: boolean;
Defined in: components/AnimationCanvas/index.tsx:63
relativeSize?
optional relativeSize?: boolean;
Defined in: components/AnimationCanvas/index.tsx:62
Type Aliases
AnimationCanvasProps
type AnimationCanvasProps = CommonProps & AbsoluteSizingProps & RelativeSizingProps;
Defined in: components/AnimationCanvas/index.tsx:66
DrawFunction
type DrawFunction = (context, option) => void;
Defined in: components/AnimationCanvas/index.tsx:28
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | - |
option | { count: number; deltaTime: number; elapsedTime: number; fps: number; height: number; width: number; } | - |
option.count | number | frame count |
option.deltaTime | number | delta time (ms) |
option.elapsedTime | number | elapsed time (ms) |
option.fps | number | frame per second |
option.height | number | current canvas height |
option.width | number | current canvas width |
Returns
void
InitFunction
type InitFunction = (context, option) => void;
Defined in: components/AnimationCanvas/index.tsx:18
Parameters
| Parameter | Type | Description |
|---|---|---|
context | CanvasRenderingContext2D | - |
option | { height: number; width: number; } | - |
option.height | number | current canvas height |
option.width | number | current canvas width |
Returns
void
Functions
AnimationCanvas()
Call Signature
function AnimationCanvas(props): ReactElement;
Defined in: components/AnimationCanvas/index.tsx:73
A simple animatable canvas with requestAnimationFrame()
Parameters
| Parameter | Type |
|---|---|
props | CommonProps & AbsoluteSizingProps & Omit<Omit<DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, "ref">, keyof CommonProps | keyof AbsoluteSizingProps | keyof RelativeSizingProps> |
Returns
ReactElement
Call Signature
function AnimationCanvas(pros): ReactElement;
Defined in: components/AnimationCanvas/index.tsx:78
A simple animatable canvas with requestAnimationFrame()
Parameters
| Parameter | Type |
|---|---|
pros | CommonProps & RelativeSizingProps & Omit<Omit<DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, "ref">, keyof CommonProps | keyof AbsoluteSizingProps | keyof RelativeSizingProps> |
Returns
ReactElement