Skip to main content

ScreenFunctions

Index

Methods

Click

  • Click(event: MouseEvent | TouchEvent): void
  • Called if the user clicks on the canvas


    Parameters

    • event: MouseEvent | TouchEvent

      The event that triggered this

    Returns void

optionalDraw

  • Draw(): void
  • Called each frame when the screen needs to be drawn.


    Returns void

optionalExit

  • Exit(): void
  • Called when user presses Esc


    Returns void

optionalKeyDown

  • KeyDown(event: KeyboardEvent): boolean
  • Called if the the user presses any key


    Parameters

    • event: KeyboardEvent

      The event that triggered this

    Returns boolean

optionalKeyUp

  • KeyUp(event: KeyboardEvent): void
  • Called if the user releases a pressed key


    Parameters

    • event: KeyboardEvent

      The event that triggered this

    Returns void

optionalLoad

  • Load(): void
  • Called when screen is loaded using CommonSetScreen


    Returns void

optionalMouseDown

  • MouseDown(event: MouseEvent | TouchEvent): void
  • Called if the user presses the mouse button or touches the touchscreen on the canvas


    Parameters

    • event: MouseEvent | TouchEvent

      The event that triggered this

    Returns void

optionalMouseMove

  • MouseMove(event: MouseEvent | TouchEvent): void
  • Called if the user moves the mouse cursor or the touch on the touchscreen over the canvas


    Parameters

    • event: MouseEvent | TouchEvent

      The event that triggered this

    Returns void

optionalMouseUp

  • MouseUp(event: MouseEvent | TouchEvent): void
  • Called if the user releases the mouse button or the touchscreen on the canvas


    Parameters

    • event: MouseEvent | TouchEvent

      The event that triggered this

    Returns void

optionalMouseWheel

  • MouseWheel(event: WheelEvent): void
  • Called if the user moves the mouse wheel on the canvas


    Parameters

    • event: WheelEvent

      The event that triggered this

    Returns void

optionalResize

  • Resize(load: boolean): void
  • Called when screen size or position changes or after screen load


    Parameters

    • load: boolean

      If the reason for call was load (true) or window resize (false)

    Returns void

Run

  • Run(time: number): void
  • Called each frame


    Parameters

    • time: number

      The current time for frame

    Returns void

optionalUnload

  • Unload(): void
  • Called when this screen is being replaced


    Returns void