Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IDrawable

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

Hierarchy

  • IDrawable

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.

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 current height of the drawing in pixels, factoring in the scale

naturalHeight

naturalHeight: number

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

naturalWidth

naturalWidth: number

Indicates the natural width of the drawing in pixels, this is the original width 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 current width of the drawing in pixels, factoring in the scale

Methods

addEffect

  • Adds a new ISpriteEffect to this drawing.

    Parameters

    Returns any

clearEffects

  • clearEffects(): any
  • Clears all effects from the drawing and return it to its original state.

    Returns any

draw

  • draw(ctx: CanvasRenderingContext2D, x: number, y: number): any
  • 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 any

removeEffect

  • removeEffect(effect: ISpriteEffect): any
  • removeEffect(index: number): any
  • removeEffect(param: any): any
  • Removes an effect ISpriteEffect from this drawing.

    Parameters

    Returns any

  • Removes an effect by index from this drawing.

    Parameters

    • index: number

      Index of the effect to remove from this drawing

    Returns any

  • Parameters

    • param: any

    Returns any

reset

  • reset(): any
  • Resets the internal state of the drawing (if any)

    Returns any