Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: EffectComponent

[16:7] extends: Component

Wraps FXGL's EffectComponent (com.almasb.fxgl.dsl.components.EffectComponent), a DSL Component that manages a set of active Effects on an Entity. Effects of the same concrete class override each other -- a newer one ends the previous one.

Methods

  • EffectComponent ()

    Creates a new EffectComponent.

  • adopt (object Ajo)

    Wraps an existing EffectComponent AussomJavaObject.

  • startEffect (object EffectObj)

    Applies the given Effect to the owning Entity. If an effect of the same Java class is already active, the old one ends and the new one replaces it.

    • @p EffectObj is an Effect wrapper.
    • @r this object
  • endEffect (object EffectObj)

    Ends the given active effect (matched by Java class).

    • @p EffectObj is an Effect wrapper.
    • @r this object
  • endAllEffects ()

    Ends every active effect.

  • hasEffect (string ClassName)

    Returns true if an effect of the given Java class is currently active.

    • @p ClassName is the fully qualified class name of the Effect subclass to check (e.g. "com.almasb.fxgl.dsl.effects.SlowTimeEffect").
    • @r A bool.