Interface GuiView

All Known Subinterfaces:
EditorView

public interface GuiView
Something that draws and takes input, in GUI-scaled pixels. Input handlers return whether they used the event.
  • Method Details

    • render

      void render(GuiFrame frame)
      Draws one frame.
      Parameters:
      frame - The frame
    • mouseClicked

      default boolean mouseClicked(GuiMouseEvent event)
    • mouseReleased

      default boolean mouseReleased(GuiMouseEvent event)
    • mouseDragged

      default boolean mouseDragged(GuiDragEvent event)
    • mouseScrolled

      default boolean mouseScrolled(GuiScrollEvent event)
    • keyPressed

      default boolean keyPressed(GuiKeyEvent event)
    • keyReleased

      default boolean keyReleased(GuiKeyEvent event)
    • charTyped

      default boolean charTyped(GuiCharEvent event)
    • opened

      default void opened()
      Called once before the first frame.
    • closed

      default void closed()
      Called once when the view goes away.
    • resized

      default void resized(double width, double height)
      Called when the window's GUI-scaled size changes.
      Parameters:
      width - New width
      height - New height
    • closeRequested

      default boolean closeRequested()
      Called when the GUI is asked to close.
      Returns:
      True to run an exit animation and call GuiSession.finishClose() when it is done, false to close at once
    • capturesKeyboard

      default boolean capturesKeyboard()
      Returns:
      Whether typing goes to this view, which keeps movement keys and binds from acting while the GUI is open
    • opacity

      default float opacity()
      Returns:
      How opaque the view is right now, 0 to 1, for example while it fades in or out. Open editors are drawn at this opacity too, so they fade with the view.
    • editorArea

      default Rect editorArea()
      Where open editors go, read every frame. By default they float over the whole screen and the view is out of reach until they close: a click outside every editor closes the newest.
      With an area, editors are placed in it by the theme's EditorLayout and the view keeps working around them. Clicks outside the editors reach the view, and editors close only when they close themselves, on Escape, or when the view closes them.
      Returns:
      The area in GUI-scaled pixels, or null for the whole screen