graphics: {
    circle: ((ctx, position, radius, options?) => void);
    clear: ((ctx, colour) => void);
    clearRect: ((ctx, rectangle, colour) => void);
    create: ((ctx) => Graphics);
    curve: ((ctx, from, to, controlPoints, options?) => void);
    dodge: ((ctx, drawingOperations) => void);
    image: ((ctx, image, position, size?) => void);
    line: ((ctx, from, to, options?) => void);
    overlay: ((ctx, drawingOperations) => void);
    rect: ((ctx, rectangle, options?) => void);
    shadow: ((ctx, drawingOperations, options?) => void);
    sprite: ((ctx, sprite) => void);
    square: ((ctx, position, size, options?) => void);
    subImage: ((ctx, image, position, size, subPosition, subSize) => void);
    text: ((ctx, position, text?, colour?, font?) => void);
    tiles: ((ctx, position, tileGrid, spriteSheets, scale) => void);
    transparency: ((ctx, drawingOperations, alpha?) => void);
}

Type declaration

  • circle: ((ctx, position, radius, options?) => void)
      • (ctx, position, radius, options?): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • position: Point
        • radius: number
        • options: CircleOptions = defaultCircle

        Returns void

  • clear: ((ctx, colour) => void)
      • (ctx, colour): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • colour: string

        Returns void

  • clearRect: ((ctx, rectangle, colour) => void)
      • (ctx, rectangle, colour): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • rectangle: Rectangle
        • colour: string

        Returns void

  • create: ((ctx) => Graphics)
  • curve: ((ctx, from, to, controlPoints, options?) => void)
      • (ctx, from, to, controlPoints, options?): void
      • Parameters

        Returns void

  • dodge: ((ctx, drawingOperations) => void)
      • (ctx, drawingOperations): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • drawingOperations: (() => void)
            • (): void
            • Returns void

        Returns void

  • image: ((ctx, image, position, size?) => void)
      • (ctx, image, position, size?): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • image: HTMLImageElement
        • position: Point
        • Optional size: Size

        Returns void

  • line: ((ctx, from, to, options?) => void)
      • (ctx, from, to, options?): void
      • Parameters

        Returns void

  • overlay: ((ctx, drawingOperations) => void)
      • (ctx, drawingOperations): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • drawingOperations: (() => void)
            • (): void
            • Returns void

        Returns void

  • rect: ((ctx, rectangle, options?) => void)
      • (ctx, rectangle, options?): void
      • Parameters

        Returns void

  • shadow: ((ctx, drawingOperations, options?) => void)
      • (ctx, drawingOperations, options?): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • drawingOperations: (() => void)
            • (): void
            • Returns void

        • options: DropShadowOptions = defaultDropShadow

        Returns void

  • sprite: ((ctx, sprite) => void)
      • (ctx, sprite): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • sprite: Sprite

        Returns void

  • square: ((ctx, position, size, options?) => void)
      • (ctx, position, size, options?): void
      • Parameters

        Returns void

  • subImage: ((ctx, image, position, size, subPosition, subSize) => void)
      • (ctx, image, position, size, subPosition, subSize): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • image: CanvasImageSource
        • position: Point
        • size: Size
        • subPosition: Point
        • subSize: Size

        Returns void

  • text: ((ctx, position, text?, colour?, font?) => void)
      • (ctx, position, text?, colour?, font?): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • position: Point
        • text: string = ''
        • colour: string = '#000000'
        • font: string = '16pt sans-serif'

        Returns void

  • tiles: ((ctx, position, tileGrid, spriteSheets, scale) => void)
      • (ctx, position, tileGrid, spriteSheets, scale): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • position: Point
        • tileGrid: number[][]
        • spriteSheets: Terrain[]
        • scale: number

        Returns void

  • transparency: ((ctx, drawingOperations, alpha?) => void)
      • (ctx, drawingOperations, alpha?): void
      • Parameters

        • ctx: CanvasRenderingContext2D
        • drawingOperations: (() => void)
            • (): void
            • Returns void

        • alpha: number = 0.25

        Returns void