Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: OffscreenPauseComponent

[19:7] extends: AccumulatedUpdateComponent

Wraps FXGL's OffscreenPauseComponent (com.almasb.fxgl.dsl.components.OffscreenPauseComponent). Pauses every other component on the entity while it is outside the viewport and resumes them when it returns. Inherits from AccumulatedUpdateComponent (checks every few frames rather than every frame). Must be constructed inside a running FXGL game.

Methods

  • OffscreenPauseComponent ()

    Creates a new OffscreenPauseComponent.

  • adopt (object Ajo)

    Wraps an existing OffscreenPauseComponent AussomJavaObject.

  • getNumFramesToSkip ()

    Returns the configured frame-skip count (int).

  • setNumFramesToSkip (int N)

    Sets the frame-skip count for the accumulated update.

    • @p N is the number of frames to skip between updates.
    • @r this object
  • onAccumulatedUpdate (double Tpf)

    Drives the accumulated update step (the engine calls this on each frame the component is not skipped). Tpf is the elapsed seconds.