FPS

<script src="./point_src/text/fps"></script>

FPS Text view. With builtin debouncer and styling features.

Quick Theatre:

files: "fps"

draw(ctx) {
    this.fps.print(ctx)
}

When loaded, an instance is applied to the stage:

class FPSExample extends Stage {
    draw(ctx){
        this.step()
        this.clear(ctx)

        // Call the function
        this.fps.drawFPS(ctx)

        // continue drawing stuff.
        this.center.pen.indicator(ctx, { color: 'gray', width: 1})
        this.mouse.point.pen.indicator(ctx, { color: 'green', width: 1})
    }
}

It's automounted on the stage for free or you can create a new instance:

stage.fps
Meta Data
title FPS
dependencies ()
unused_keys ()
unknown_keys ('files',)
files ['', 'smooth-number.js']
filepath_exists True
path text/fps
filepath text/fps.js
clean_files ('smooth-number.js',)

  • ClassDeclaration
    class comments:

    Higher is a longer delay between visual text updates.

    • property

      color

      = 'green'
      from FPS
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos', 'class_name'])
    • property

      modulusRate

      = 10
      from FPS
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos', 'class_name'])
    • property

      width

      = 20
      from FPS
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos', 'class_name'])
    • property

      fixed

      = 0
      from FPS
      dict_keys(['kind', 'word', 'computed', 'static', 'value', 'type', 'pos', 'class_name'])
    • constructor

      constructor

      (
      stage , text = undefined
      )
      from FPS
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      setup

      (
      )
      from FPS
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      Called during prep.

    • method

      update

      (
      )
      from FPS
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      Update is for data.

      drawFPS(ctx) { t = new FPS(stage) t.update() t.draw(ctx, color) }

    • method

      draw

      (
      ctx , color
      )
      from FPS
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      Draw is for visual

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])
  • ClassDeclaration
    class comments:

    tools to extend the stage.

    • constructor

      constructor

      (
      stage
      )
      from FramerateExt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      tools to extend the stage.

    • method

      drawFPS

      (
      ctx
      )
      from FramerateExt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])
    • method

      print

      (
      ctx
      )
      from FramerateExt
      dict_keys(['kind', 'word', 'static', 'computed', 'is_symbol', 'value', 'type', 'comments', 'pos', 'class_name'])

      shortcut for the drawFPS

    dict_keys(['kind', 'word', 'parentName', 'type', 'body', 'comments', 'pos'])
  • ExpressionStatement

    :

    dict_keys(['type', 'expression', 'pos'])