Class GuiAreaRecorder

java.lang.Object
net.ixdarklord.coolcatcanvas.internal.client.gui.GuiAreaRecorder

public final class GuiAreaRecorder extends Object
Records the box of everything the HUD and the open screen's own pass draw each frame, and keeps the last whole frame's for GuiAreas. 1.20.1 draws at once rather than gathering a render state, so the boxes come from the draw calls every GUI draw ends in (GuiGraphicsMixin, FontMixin), while GameRendererMixin and ScreenMixin say which is being drawn and ScreenMixin and AbstractContainerScreenMixin pause it over the screen's background. Render thread only.
  • Method Details

    • begin

      public static GuiAreaRecorder.Phase begin(GuiAreaRecorder.Phase now)
      Starts recording for this part of the frame; returns the part it was, to end(net.ixdarklord.coolcatcanvas.internal.client.gui.GuiAreaRecorder.Phase) with.
    • end

      public static void end(GuiAreaRecorder.Phase was)
    • pause

      public static void pause()
    • resume

      public static void resume()
    • recording

      public static boolean recording()
      Whether a draw now would be recorded, so the callers can skip working out its box when it wouldn't.
    • record

      public static void record(int x, int y, int width, int height)
      Records a box already in screen space, in GUI pixels.
    • record

      public static void record(org.joml.Matrix4f pose, float x1, float y1, float x2, float y2)
      Records a box drawn under a pose: its corners are taken to screen space (x and y only; the GUI's depth doesn't move anything sideways) and the box round them is recorded, so a scaled or turned draw is recorded where it shows.
    • endFrame

      public static void endFrame()
      The frame is all drawn: what it drew becomes what the areas are.
    • hud

      public static List<GuiArea> hud()
    • screen

      public static List<GuiArea> screen()