Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ProfilerService

[21:7] extends: EngineService

Wraps FXGL's ProfilerService (com.almasb.fxgl.dev.profiling.ProfilerService), an EngineService that maintains three ProfilerWindow charts on the scene overlay: FPS, CPU time per frame (ms), and RAM usage (MB). Updates each chart every frame and logs a summary on engine exit. Registered with the engine; reach via fxgl.getService( "com.almasb.fxgl.dev.profiling.ProfilerService") and adopt. Direct construction from Aussom is not useful because the service depends on engine-injected fields.

Methods

  • ProfilerService ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing ProfilerService AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a ProfilerService.
    • @r A new wrapper.
  • onUpdate (double Tpf)

    Per-frame update hook (the EngineService contract). Updates each profiler window with the latest FPS, CPU, and RAM measurement.

    • @p Tpf is the per-frame time in seconds.
    • @r this object