On this page

britzl/defold-metrics/metrics.fps

Calculate and display performance metrics in Defold games

  • GitHub: britzl/defold-metrics — pinned to 2fe3aed
    1. Pick a release from britzl/defold-metrics releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as fps from "metrics.fps"

Functions

create(samples?: number, format?: string, position?: string, color?: string): Metrics

Parameters

  • samples?: number
  • format?: string
  • position?: string
  • color?: string

Returns

  • Metrics

Types

Metrics.fps: () => number

Metrics.update: () => void

Metrics.draw: () => void