Polygon
Hierarchy
- Raster
- Polygon
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
options: RasterOptions & PolygonOptions
Returns Polygon
Properties
publicinherited_bitmap
publicoptionalinheritedfiltering
readonlyinheritedid
publicinheritedlineCap
publicinheritedopacity
Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).
publicinheritedquality
publicinheritedshowDebug
Gets or sets wether to show debug information about the graphic
publicoptionalinheritedtint
publicinheritedtransform
Accessors
publicinheritedcolor
publicinheriteddirty
Gets whether the graphic is dirty, this means there are changes that haven't been re-rasterized
Returns boolean
publicinheritedflipHorizontal
Gets or sets the flipHorizontal, which will flip the graphic horizontally (across the y axis)
Returns boolean
Parameters
value: boolean
Returns void
publicinheritedflipVertical
Gets or sets the flipVertical, which will flip the graphic vertically (across the x axis)
Returns boolean
Parameters
value: boolean
Returns void
publicinheritedheight
Gets or sets the current height of the Raster graphic. Setting the height will cause the raster to be flagged dirty causing a re-raster on the next draw.
Any
paddingorqualityset will be factored into the heightReturns number
Gets or sets the height of the graphic (always positive)
Parameters
value: number
Returns void
publicinheritedlineDash
Returns number[]
Parameters
value: number[]
Returns void
publicinheritedlineWidth
Gets or sets the line width of the Raster graphic. Setting the lineWidth will cause the raster to be flagged dirty causing a re-raster on the next draw.
Returns number
Parameters
value: number
Returns void
publicinheritedlocalBounds
Returns the local bounds of the Raster including the padding
Returns BoundingBox
publicminPoint
Returns Vector
publicinheritedorigin
publicinheritedpadding
Returns number
Parameters
value: number
Returns void
publicpoints
publicinheritedrotation
Gets or sets the rotation of the graphic
Returns number
Parameters
value: number
Returns void
publicinheritedscale
publicinheritedsmoothing
Gets or sets the smoothing (anti-aliasing of the graphic). Setting the height will cause the raster to be flagged dirty causing a re-raster on the next draw.
Returns boolean
Parameters
value: boolean
Returns void
publicinheritedstrokeColor
publicinheritedwidth
Gets or sets the current width of the Raster graphic. Setting the width will cause the raster to be flagged dirty causing a re-raster on the next draw.
Any
paddings orqualityset will be factored into the widthReturns number
Gets or sets the width of the graphic (always positive)
Parameters
value: number
Returns void
Methods
publicclone
Returns a new instance of the graphic that has the same properties
Returns Polygon
publicinheritedcloneGraphicOptions
Returns GraphicOptions
publicinheritedcloneRasterOptions
Returns RasterOptions
publicinheriteddraw
Draw the whole graphic to the context including transform
Parameters
ex: ExcaliburGraphicsContext
The excalibur graphics context
x: number
y: number
Returns void
execute
Executes drawing implementation of the graphic, this is where the specific drawing code for the graphic should be implemented. Once
rasterize()the graphic can be drawn to the ExcaliburGraphicsContext viadraw(...)Parameters
ctx: CanvasRenderingContext2D
Canvas to draw the graphic to
Returns void
publicinheritedflagDirty
Flags the graphic as dirty, meaning it must be re-rasterized before draw. This should be called any time the graphics state changes such that it affects the outputted drawing
Returns void
publicinheritedisStale
Returns boolean
publicinheritedrasterize
Rasterize the graphic to a bitmap making it usable as in excalibur. Rasterize is called automatically if the graphic is Raster.dirty on the next Graphic.draw call
Returns void
A polygon Graphic for drawing arbitrary polygons to the ExcaliburGraphicsContext
Polygons default to ImageFiltering.Blended