Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: SpawnData

[13:7] extends: FxObj

Wraps FXGL's SpawnData, the bundle of (x, y, z) coordinates plus an arbitrary key-value map passed to GameWorld.spawn and consumed by an EntityFactory's @Spawns-annotated method. Use put to attach additional data the factory reads via get.

Methods

  • SpawnData (double X = 0.0, double Y = 0.0, double Z = 0.0)

    Creates a new SpawnData at the given coordinates.

    • @p X is the X position.
    • @p Y is the Y position.
    • @p Z is the optional Z position (defaults to 0.0).
  • adopt (object Ajo)

    Wraps an existing SpawnData AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a SpawnData.
    • @r A new wrapper.
  • put (string Key, Value)

    Stores a value under the given key for the entity factory to read via get(Key).

    • @p Key is the data key.
    • @p Value is the value to store.
    • @r this object
  • hasKey (string Key)

    Returns whether Key was set on this SpawnData.

    • @p Key is the data key.
    • @r A bool.
  • get (string Key)

    Returns the stored value under Key. Throws if the key is missing.

    • @p Key is the data key.
    • @r The stored value (AussomJavaObject or primitive).
  • getX ()

    Returns the X coordinate.

    • @r A double.
  • getY ()

    Returns the Y coordinate.

    • @r A double.
  • getZ ()

    Returns the Z coordinate.

    • @r A double.