Set the font filtering mode, by default set to ImageFiltering.Blended regardless of the engine default smoothing
If you have a pixel style font that may be a reason to switch this to ImageFiltering.Pixel
Readonly
idGets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).
Font quality determines the size of the underlying raster text, higher quality means less jagged edges. If quality is set to 1, then just enough raster bitmap is generated to render the text.
You can think of quality as how zoomed in to the text you can get before seeing jagged edges.
(Default 2)
Gets or sets wether to show debug information about the graphic
Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis)
Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis)
Gets or sets the height of the graphic (always positive)
Gets a copy of the bounds in pixels occupied by the graphic on the the screen. This includes scale.
Gets or sets the rotation of the graphic
Gets or sets the width of the graphic (always positive)
Protected
_drawMeant to be overridden by the graphic implementation to draw the underlying image (HTMLCanvasElement or HTMLImageElement) to the graphics context without transform. Transformations like position, rotation, and scale are handled by Graphic._preDraw and Graphic._postDraw
The excalibur graphics context
Protected
_flipProtected
_postApply any additional work after Graphic._drawImage and restore the context state.
Protected
_preApply affine transformations to the graphics context to manipulate the graphic before Graphic._drawImage
Protected
_rotateDraw the whole graphic to the context including transform
The excalibur graphics context
Returns a BoundingBox that is the total size of the text including multiple lines
Does not include any padding or adjustment
BoundingBox
Optional
maxWidth: numberOptional
maxWidth: numberOptional
maxWidth: number
Represents a system or web font in Excalibur
If no options specified, the system sans-serif 10 pixel is used
If loading a custom web font be sure to have the font loaded before you use it https://erikonarheim.com/posts/dont-test-fonts/