Expand description
Screen Transition Manager — handles visual transitions between game screens.
Supports multiple transition types: FadeBlack, Dissolve, Slide, ZoomIn, ChaosWipe. Each transition captures the outgoing screen state, tweens a visual effect, and reveals the incoming screen.
§Usage
use proof_engine::game::transitions::*;
let mut tm = TransitionManager::new();
tm.start(TransitionType::FadeBlack {
out_time: 0.2, hold_time: 0.05, in_time: 0.2,
});
// Each frame:
tm.tick(dt);
if tm.should_swap_state() {
// swap game state here
tm.acknowledge_swap();
}
// Render the transition overlay:
let overlay = tm.render_overlay(screen_width, screen_height);Structs§
- Game
Transitions - Pre-configured transitions for specific game state changes.
- Screenshot
- Captured framebuffer of the previous screen for cross-fade transitions.
- Transition
Manager - Manages screen-to-screen visual transitions.
- Transition
Overlay - A full-screen overlay quad produced by the transition for rendering.
- Transition
Queue - A queue of pending transitions. Useful when multiple transitions might be requested in quick succession (e.g. combat → floor nav → shop).
- Transition
Request - Queued transition request — allows scheduling transitions from game logic.
- Transition
Stats - Per-frame statistics.
Enums§
- Transition
Easing - Easing functions for transition curves.
- Transition
Effect - Which visual effect the renderer should use.
- Transition
State - Current phase of a screen transition.
- Transition
Type - Visual effect used for the screen transition.