Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: CollidableComponent

[16:7] extends: BooleanComponent

Wraps FXGL's CollidableComponent, the marker component that opts an entity into the FXGL collision system. Without it, an entity's HitBox is not checked against other entities. Attach to any entity that should participate in collision-handler dispatch.

Methods

  • CollidableComponent (bool Value = true)

    Creates a new CollidableComponent.

    • @p Value is the initial collidable state (defaults to true).
  • isCollidable ()

    Returns whether the component is currently collidable.

    • @r A bool.
  • setCollidable (bool Value)

    Sets the collidable state.

    • @p Value is the new state.
    • @r this object
  • addIgnoredType (Type)

    Adds an entity type to the ignored list. Collisions with entities of that type are skipped entirely.

    • @p Type is the type value (enum or string).
    • @r this object
  • removeIgnoredType (Type)

    Removes an entity type from the ignored list.

    • @p Type is the type value.
    • @r this object
  • getIgnoredTypes ()

    Returns the ignored-type list as an AussomJavaObject around a List.

    • @r An AussomJavaObject around the ignored-type list.