Skip to main content

DrawFunction

The DrawFunction type represents the function that is called every frame to draw an object in the game.


Definition

type DrawFunction = (ctx: CanvasRenderingContext2D) => void;

Parameters

  • ctx
    • Type: CanvasRenderingContext2D
    • The canvas rendering context on which the object will be drawn.

Return Value

  • void