Fudge Core
    Preparing search index...

    Class Loop

    Core loop of a FUDGE application. Initializes automatically and must be started explicitly. It then fires EVENT.LOOP_FRAME to all added listeners at each frame

    Jirka Dell'Oro-Friedl, HFU, 2019

    Hierarchy (View Summary)

    Index

    Accessors

    • get timeStartGame(): number

      The gametime the loop was started, overwritten at each start

      Returns number

    • get timeStartReal(): number

      The realtime the loop was started, overwritten at each start

      Returns number

    Methods

    • Add an event listener to targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • Remove an event listener from targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • Starts the loop with the given mode and fps.
      The default for _mode is FRAME_REQUEST, see LOOP_MODE, hooking the loop to the browser's animation frame. Is only applicable in TIME-modes. _syncWithAnimationFrame is experimental and only applicable in TIME-modes, deferring the loop-cycle until the next possible animation frame.

      Parameters

      • _mode: LOOP_MODE = LOOP_MODE.FRAME_REQUEST
      • _fps: number = 60
      • _syncWithAnimationFrame: boolean = false

      Returns void