Interface Behavior

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
AbstractBehavior, AbstractRenderable, AnimationPlayer, Application, AudioPlayer, BlankScene, BoxCollider2D, CircleCollider2D, Collider2D, ComponentBehavior, DistanceJoint2D, EdgeCollider2D, EmptyRenderable, Entity2D, Entity2DContainer, Joint2D, PhysicsBody, PhysicsSystem, RectangleMesh, RevoluteJoint2D, Scene, SystemBehavior, TextMesh, TexturedRectangleMesh

public interface Behavior extends Closeable
This interface represents a behavior that can be started and updated over time. It extends the Closeable interface to allow for proper resource management.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method is called when the behavior is started.
    void
    This method is called when the behavior needs to be updated with the current time.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • onStart

      void onStart()
      This method is called when the behavior is started. It is typically used to initialize any necessary state or resources.
    • onUpdate

      void onUpdate(ContextTime time)
      This method is called when the behavior needs to be updated with the current time. It is typically used to perform any necessary calculations or updates based on the current time.
      Parameters:
      time - The current time context.