Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Particle

[25:7] extends: Poolable

Wraps FXGL's Particle (com.almasb.fxgl.particle.Particle), the per-particle handle owned by a ParticleEmitter. Particles are pooled — the engine instantiates and recycles them — so the Aussom wrapper is mostly for adopting an AJO inside an emitter callback (setSpawnPointFunction, control consumer, etc.). The public surface is small:

  • position, velocity, acceleration — live Vec2 fields you can read and mutate in place.
  • life — seconds remaining until despawn.
  • getView() — the JavaFX Node (Ellipse or ImageView) used to render the particle.

Methods

  • Particle ()

    Empty default constructor; populated by adopt.

  • adopt (object Ajo)

    Wraps an existing Particle AussomJavaObject.

  • getPosition ()

    Returns the current position as a Vec2 wrapper.

  • getVelocity ()

    Returns the velocity (pixels/sec) as a Vec2 wrapper.

  • getAcceleration ()

    Returns the acceleration (pixels/sec^2) as a Vec2 wrapper.

  • getLife ()

    Returns the remaining life in seconds.

  • setLife (double V)

    Sets the remaining life in seconds.

  • getView ()

    Returns the JavaFX Node used to render the particle.

    • @r A raw JavaFX Node AJO (Ellipse or ImageView).
  • reset ()

    Returns the particle to the pool.