Class PlayerScreenTransitionComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.player.PlayerScreenTransitionComponent

public class PlayerScreenTransitionComponent extends Component
Handles the screen transition visual effect for the player. Listens for a "transition_start" event and creates a closing vignette centered on the player.
  • Constructor Details

    • PlayerScreenTransitionComponent

      public PlayerScreenTransitionComponent()
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component
    • startEffect

      public void startEffect(float duration, Runnable onComplete)
      Starts the screen transition effect if not running already
      Parameters:
      duration - The duration of the transition effect in seconds.
      onComplete - A Runnable to execute when the transition is complete.
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component
    • dispose

      public void dispose()
      Description copied from class: Component
      Called when the component is disposed. Dispose of any internal resources here.
      Overrides:
      dispose in class Component