Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: IDComponent

[14:7] extends: Component

Wraps FXGL's IDComponent (com.almasb.fxgl.entity.components.IDComponent), the per- entity identity tag used by GameWorld.getEntityByID(name, id). Holds a (name, id) pair that survives save/restore.

Methods

  • IDComponent (string Name = "default", int Id = 0)

    Creates a new IDComponent.

    • @p Name is the identity name (typically the @Spawns name).
    • @p Id is the integer identifier.
  • adopt (object Ajo)

    Wraps an existing IDComponent AussomJavaObject.

  • getName ()

    Returns the identity name.

  • getId ()

    Returns the integer identifier.

  • getFullID ()

    Returns the underlying String identifier ("name:id").

  • setName (string V)

    Sets the identity name (the prefix in "name:id").

  • write (object BundleObj)

    Persists this id component into a Bundle.

  • read (object BundleObj)

    Restores this id component from a Bundle.