Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FrameData

[13:7] extends: FxObj

Wraps FXGL's FrameData (com.almasb.fxgl.texture.FrameData), the per-frame data record returned by AnimationChannel.getFrameData(i). Carries the source pixel rectangle (x, y, width, height) plus a pre-built JavaFX Rectangle2D viewport and per-frame draw offsets.

Methods

  • FrameData (int X = 0, int Y = 0, int Width = 0, int Height = 0)

    Creates a new FrameData with the given source rectangle.

    • @p X is the source x pixel.
    • @p Y is the source y pixel.
    • @p Width is the source pixel width.
    • @p Height is the source pixel height.
  • adopt (object Ajo)

    Wraps an existing FrameData AussomJavaObject.

  • getX ()

    Returns the source x pixel.

  • getY ()

    Returns the source y pixel.

  • getWidth ()

    Returns the source pixel width.

  • getHeight ()

    Returns the source pixel height.

  • getViewport ()

    Returns the prebuilt JavaFX Rectangle2D viewport (x, y, w, h) to feed into ImageView.setViewport.

  • getOffsetX ()

    Returns the per-frame horizontal draw offset.

  • setOffsetX (int V)

    Sets the per-frame horizontal draw offset.

  • getOffsetY ()

    Returns the per-frame vertical draw offset.

  • setOffsetY (int V)

    Sets the per-frame vertical draw offset.