Class PlayerScreenTransitionComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.player.PlayerScreenTransitionComponent
Handles the screen transition visual effect for the player.
Listens for a "transition_start" event and creates a closing vignette
centered on the player.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when the entity is created and registered.voiddispose()Called when the component is disposed.voidstartEffect(float duration, Runnable onComplete) Starts the screen transition effect if not running alreadyvoidupdate()Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
PlayerScreenTransitionComponent
public PlayerScreenTransitionComponent()
-
-
Method Details
-
create
public void create()Description copied from class:ComponentCalled 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. -
startEffect
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:ComponentCalled once per frame of the game, and should be used for most component logic. Not called if component is disabled. -
dispose
public void dispose()Description copied from class:ComponentCalled when the component is disposed. Dispose of any internal resources here.
-