Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ProfilerWindow

[21:7] extends: MDIWindow

Wraps FXGL's ProfilerWindow (com.almasb.fxgl.dev.profiling.ProfilerWindow), an MDIWindow subclass that renders a rolling line chart of a single double-valued metric. The window tracks min, max, average, and an "all-time" min / max for logging at engine exit. Each window is fixed-size, closeable false, minimizable true, movable true. Game code can construct one to host a custom metric, then add the underlying MDIWindow to a scene overlay.

Methods

  • ProfilerWindow (Width = null, double Height = 0.0, string Title = "")

    Creates a new ProfilerWindow of the given size and title. Pass null for Width to construct an empty wrapper for adopt.

    • @p Width is the chart width in pixels, or null.
    • @p Height is the chart height in pixels.
    • @p Title is the window title.
  • adopt (object Ajo)

    Wraps an existing ProfilerWindow AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a ProfilerWindow.
    • @r A new wrapper.
  • getMeasuringUnitsName ()

    Returns the units string shown alongside the value label.

    • @r A string.
  • setMeasuringUnitsName (string Name)

    Sets the units string shown alongside the value label.

    • @p Name is the units string.
    • @r this object
  • getNumYTicks ()

    Returns the number of Y-axis tick marks.

    • @r An int.
  • setNumYTicks (int Ticks)

    Sets the number of Y-axis tick marks.

    • @p Ticks is the new tick count.
    • @r this object
  • getDurationX ()

    Returns the X-axis duration in seconds the chart is tracking.

    • @r A double.
  • setDurationX (double Duration)

    Sets the X-axis tracking duration in seconds.

    • @p Duration is the new duration.
    • @r this object
  • getMaxBufferSize ()

    Returns the maximum buffer size for stored values.

    • @r An int.
  • setMaxBufferSize (int Size)

    Sets the maximum buffer size for stored values.

    • @p Size is the new size.
    • @r this object
  • getPreferredMaxValue ()

    Returns the preferred-max threshold. When the current value stays below this for 300 updates, the chart's max-value resets to this preferred max.

    • @r A double.
  • setPreferredMaxValue (double Value)

    Sets the preferred-max threshold.

    • @p Value is the new preferred max.
    • @r this object
  • getMinValue ()

    Returns the lowest value seen since the chart started.

    • @r A double.
  • setMinValue (double Value)

    Sets the chart's tracked minimum value.

    • @p Value is the new minimum.
    • @r this object
  • getCurValue ()

    Returns the most recent value pushed via update.

    • @r A double.
  • setCurValue (double Value)

    Sets the chart's current value.

    • @p Value is the new current value.
    • @r this object
  • getMaxValue ()

    Returns the highest value seen since the chart started.

    • @r A double.
  • setMaxValue (double Value)

    Sets the chart's tracked maximum value.

    • @p Value is the new maximum.
    • @r this object
  • getBgColor ()

    Returns the background color.

    • @r An AussomJavaObject around a Color.
  • setBgColor (object ColorObj)

    Sets the background color.

    • @p ColorObj is a Color wrapper.
    • @r this object
  • getTextColor ()

    Returns the tick-label text color.

    • @r An AussomJavaObject around a Color.
  • setTextColor (object ColorObj)

    Sets the tick-label text color.

    • @p ColorObj is a Color wrapper.
    • @r this object
  • getChartColor ()

    Returns the chart line color.

    • @r An AussomJavaObject around a Color.
  • setChartColor (object ColorObj)

    Sets the chart line color.

    • @p ColorObj is a Color wrapper.
    • @r this object
  • update (double Value)

    Pushes a new value, updates running stats and re-paints the chart.

    • @p Value is the new sample value.
    • @r this object
  • log ()

    Logs the chart's frame count, average, all-time low, and all-time high to the FXGL logger.

    • @r this object