CanvasOptions
The CanvasOptions
interface represents the options for configuring the game canvas.
Definition
interface CanvasOptions {
parent?: HTMLElement;
size?: Point;
autoSize?: boolean;
imageSmoothingEnabled?: boolean;
imageSmoothingQuality?: ImageSmoothingQuality;
backgroundColor?: string;
}
Properties
parent
- Type:
HTMLElement
(optional)- Default value:
document.body
- Default value:
The parent element to insert the canvas.
size
- Type:
Point
(optional)- Default value:
new Point(800, 600)
- Default value:
The size of the canvas.
autoSize
- Type:
boolean
(optional)- Default value:
true
- Default value:
Determines whether the canvas should automatically resize to fit the parent element.
imageSmoothingEnabled
- Type:
boolean
(optional)- Default value:
false
- Default value:
Determines whether image smoothing is enabled
imageSmoothingQuality
- Type:
ImageSmoothingQuality
(optional)- Default value:
high
- Default value:
The quality of image smoothing.
(none effective if imageSmoothingEnable
is set to false
)
backgroundColor
- Type:
string
(optional)- Default value:
#000000
- Default value:
The background color of the canvas.