Class GuiViewTransition

java.lang.Object
com.render.api.gui.GuiViewTransition

public final class GuiViewTransition extends Object
Coordinates one retained old/new visual transition for a GUI host.

start(Runnable) snapshots the currently laid-out retained tree and captures the current framebuffer pixels, performs the mutation synchronously, and captures the new tree on the next layout. The old pixel texture is remapped over morphing bounds; retained box paint is the allocation-failure fallback. Starting another transition cancels the prior run and uses its current composited geometry as the new old state. Retained component identity is matched first, followed by an explicit transition name or component ID. Anonymous recreated nodes are never paired merely because they occupy the same structural path. Retained or stably identified nodes morph between their old and new bounds; genuinely new nodes fade in and removed nodes fade out.

  • Method Details

    • duration

      public GuiViewTransition duration(double seconds)
      Selects the transition duration.
      Parameters:
      seconds - non-negative seconds
      Returns:
      this transition controller
    • easing

      public GuiViewTransition easing(GuiEasing easing)
      Selects the progress easing.
      Parameters:
      easing - easing function
      Returns:
      this transition controller
    • start

      public GuiViewTransition start(Runnable mutation)
      Captures the old retained state and framebuffer texture, then applies the state mutation.

      Only one transition can run per host. A replacement begins from the currently composited geometry of the active transition. Unchanged retained components remain continuously painted by the live tree. Retained instances and recreated components with a matching ID morph between bounds; anonymous entrants fade in and removed nodes fade out.

      Parameters:
      mutation - synchronous retained-tree mutation
      Returns:
      this transition controller
    • skipTransition

      public void skipTransition()
      Ends the active transition immediately.
    • state

      public GuiViewTransition.State state()
    • active

      public boolean active()
    • failureReason

      public String failureReason()
    • ready

      public CompletionStage<Void> ready()
      Completes when both old and new snapshots exist.
      Returns:
      readiness stage for the current run
    • finished

      public CompletionStage<Void> finished()
      Completes when the current run finishes or is skipped.
      Returns:
      completion stage for the current run
    • snapshots

      public List<GuiViewTransition.Snapshot> snapshots()
      Returns inspectable immutable snapshot geometry.
      Returns:
      old and new snapshot records