Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for implementing anything in Excalibur that can be drawn to the screen.

Hierarchy

  • Drawable

Implemented by

Index

Properties

anchor

anchor: Vector

Gets or sets the point about which to apply transformations to the drawing relative to the top left corner of the drawing.

drawHeight

drawHeight: number

Indicates the current height of the drawing in pixels, factoring in the scale

drawWidth

drawWidth: number

Indicates the current width of the drawing in pixels, factoring in the scale

flipHorizontal

flipHorizontal: boolean

Indicates whether the drawing is to be flipped horizontally

flipVertical

flipVertical: boolean

Indicates whether the drawing is to be flipped vertically

height

height: number

Indicates the natural height of the drawing in pixels, this is the original height of the source image

rotation

rotation: number

Sets the current rotation transformation for the drawing.

scale

scale: Vector

Gets or sets the scale transformation

width

width: number

Indicates the natural width of the drawing in pixels, this is the original width of the source image

Methods

addEffect

clearEffects

  • clearEffects(): void

draw

  • draw(ctx: CanvasRenderingContext2D, x: number, y: number): void
  • draw(options: DrawOptions): void
  • Draws the sprite appropriately to the 2D rendering context.

    Parameters

    • ctx: CanvasRenderingContext2D

      The 2D rendering context

    • x: number

      The x coordinate of where to draw

    • y: number

      The y coordinate of where to draw

    Returns void

  • Draws the sprite with custom options to override internals without mutating them.

    Parameters

    Returns void

removeEffect

  • removeEffect(effect: SpriteEffect): void
  • removeEffect(index: number): void
  • removeEffect(param: any): void

reset

  • reset(): void