Lifecycle
Overview
This section covers the Lifecycle methods that manage existing Fracture Pieces after they've been created.
- .Clear() destroys all Pieces instantly.
- .ForceFade() begins fading all Pieces out.
- .Pause() and .Resume() freeze and unfreeze Piece fade processing.
All Lifecycle methods apply to all existing Pieces.
Methods
.Clear()
Destroys all existing Fracture Pieces immediately.
Use it to wipe debris whenever you need a clean slate.
.ForceFade()
Begins fading out all existing Fracture Pieces immediately.
Use it for a soft clear that lets debris fade out gradually instead of instantly vanishing.
TIP
Pieces with a fade speed of 0 are not affected, since they have no fade rate to apply. Set fade speed via .Fade().
.Pause()
Pauses fade processing on all existing Fracture Pieces.
This only halts fading. It does not pause the physics world itself, so Pieces keep moving. Pair it with physics_pause_enable(true) to completely freeze Pieces in place.
// A function for pausing the game
function PauseGame() {
global.paused = true;
physics_pause_enable(true);
Fracture.Pause();
audio_pause_all();
// Other pausing logic...
}.Resume()
Resumes fade processing on all paused Fracture Pieces.
Pair it with physics_pause_enable(false) to resume the physics simulation alongside fading.
// A function for resuming the game
function ResumeGame() {
global.paused = false;
physics_pause_enable(false);
Fracture.Resume();
audio_resume_all();
// Other resuming logic...
}