GraphicsGroup
Hierarchy
- Graphic
- GraphicsGroup
Implements
Index
Constructors
constructor
Parameters
options: GraphicsGroupingOptions & GraphicOptions
Returns GraphicsGroup
Properties
readonlyinheritedid
publicmembers
publicinheritedopacity
Gets or sets the opacity of the graphic, 0 is transparent, 1 is solid (opaque).
publicshouldAlwaysTick
Optional property to tick any graphics EVEN when offscreen, this is useful when you want to keep animations synchronized across your game scene.
publicinheritedshowDebug
Gets or sets wether to show debug information about the graphic
publicoptionalinheritedtint
publicinheritedtransform
publicuseAnchor
Accessors
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 height of the graphic (always positive)
Returns number
Parameters
value: number
Returns void
publiclocalBounds
Gets a copy of the bounds in pixels occupied by the graphic on the the screen. This includes scale.
Returns BoundingBox
publicinheritedorigin
publicinheritedrotation
Gets or sets the rotation of the graphic
Returns number
Parameters
value: number
Returns void
publicinheritedscale
publicinheritedwidth
Gets or sets the width of the graphic (always positive)
Returns number
Parameters
value: number
Returns void
Methods
publicclone
Returns a new instance of the graphic that has the same properties
Returns GraphicsGroup
publicinheritedcloneGraphicOptions
Returns GraphicOptions
publicinheriteddraw
Draw the whole graphic to the context including transform
Parameters
ex: ExcaliburGraphicsContext
The excalibur graphics context
x: number
y: number
Returns void
publicinheritedisStale
Returns boolean
publicreset
Returns void
publictick
Parameters
elapsed: number
The amount of real world time in milliseconds that has elapsed that must be updated in the animation
optionalidempotencyToken: number
Optional idempotencyToken prevents a ticking animation from updating twice per frame
Returns void
A Graphic is the base Excalibur primitive for something that can be drawn to the ExcaliburGraphicsContext. Sprite, Animation, GraphicsGroup, Canvas, Rectangle, Circle, and Polygon all derive from the Graphic abstract class.
Implementors of a Graphic must override the abstract Graphic._drawImage method to render an image to the graphics context. Graphic handles all the position, rotation, and scale transformations in Graphic._preDraw and Graphic._postDraw