Class CottonClientScreen

All Implemented Interfaces:
io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl, Drawable, Element, Navigable, ParentElement

public class CottonClientScreen extends Screen implements io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
  • Field Details

    • description

      protected GuiDescription description
    • left

      protected int left
    • top

      protected int top
    • titleX

      protected int titleX
      The X coordinate of the screen title. This is relative to the root panel's top-left corner.
      Since:
      2.0.0
    • titleY

      protected int titleY
      The Y coordinate of the screen title. This is relative to the root panel's top-left corner.
      Since:
      2.0.0
    • lastResponder

      @Nullable protected @Nullable WWidget lastResponder
  • Constructor Details

    • CottonClientScreen

      public CottonClientScreen(GuiDescription description)
    • CottonClientScreen

      public CottonClientScreen(Text title, GuiDescription description)
  • Method Details

    • getDescription

      public GuiDescription getDescription()
      Specified by:
      getDescription in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • init

      public void init()
      Overrides:
      init in class Screen
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • getLastResponder

      @Nullable public @Nullable WWidget getLastResponder()
      Specified by:
      getLastResponder in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • setLastResponder

      public void setLastResponder(@Nullable @Nullable WWidget lastResponder)
      Specified by:
      setLastResponder in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • reposition

      protected void reposition(int screenWidth, int screenHeight)
      Repositions the root panel.
      Parameters:
      screenWidth - the width of the screen
      screenHeight - the height of the screen
    • render

      public void render(DrawContext context, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface Drawable
      Overrides:
      render in class Screen
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
      Specified by:
      mouseClicked in interface Element
      Specified by:
      mouseClicked in interface ParentElement
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int mouseButton)
      Specified by:
      mouseReleased in interface Element
      Specified by:
      mouseReleased in interface ParentElement
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY)
      Specified by:
      mouseDragged in interface Element
      Specified by:
      mouseDragged in interface ParentElement
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
      Specified by:
      mouseScrolled in interface Element
      Specified by:
      mouseScrolled in interface ParentElement
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Specified by:
      mouseMoved in interface Element
    • charTyped

      public boolean charTyped(char ch, int keyCode)
      Specified by:
      charTyped in interface Element
      Specified by:
      charTyped in interface ParentElement
    • keyPressed

      public boolean keyPressed(int ch, int keyCode, int modifiers)
      Specified by:
      keyPressed in interface Element
      Specified by:
      keyPressed in interface ParentElement
      Overrides:
      keyPressed in class Screen
    • keyReleased

      public boolean keyReleased(int ch, int keyCode, int modifiers)
      Specified by:
      keyReleased in interface Element
      Specified by:
      keyReleased in interface ParentElement
    • addElementNarrations

      protected void addElementNarrations(NarrationMessageBuilder builder)
      Overrides:
      addElementNarrations in class Screen