Class WidgetScreenAddon

java.lang.Object
com.hrznstudio.titanium.client.screen.addon.BasicScreenAddon
com.hrznstudio.titanium.client.screen.addon.WidgetScreenAddon
All Implemented Interfaces:
IScreenAddon, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.TabOrderedElement

public class WidgetScreenAddon extends BasicScreenAddon
  • Field Summary

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    WidgetScreenAddon(int posX, int posY, net.minecraft.client.gui.components.AbstractWidget widget)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    charTyped(char codePoint, int modifiers)
    Called when a specific 'Character' is typed
    void
    drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
    Draws the component in the background layer
    void
    drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
    Draws the component in the foreground layer
    net.minecraft.client.gui.components.AbstractWidget
     
    int
     
    int
     
    void
    init(int screenX, int screenY)
    Called when init is called in the screen.
    boolean
     
    boolean
    isMouseOver(double mouseX, double mouseY)
    Checks whether the mouse if over a specific object or point
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
    Called when a key is pressed
    boolean
    keyReleased(int keyCode, int scanCode, int modifiers)
    Called when a key is pressed
    boolean
    mouseClicked(double mouseX, double mouseY, int button)
    Called when a mouse button is clicked
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
    Called when the mouse is pressed and dragged
    void
    mouseMoved(double xPos, double yPos)
    Called when the mouse is moved.
    boolean
    mouseReleased(double mouseX, double mouseY, int button)
    Called when the mouse button is released
    boolean
    mouseScrolled(double mouseX, double mouseY, double delta)
    Called when mouse scroll is applied
    void
    setFocused(boolean focus)
    Called when Screen Focus changes

    Methods inherited from class com.hrznstudio.titanium.client.screen.addon.BasicScreenAddon

    getPosX, getPosY, setPosX, setPosY

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    getCurrentFocusPath, getRectangle, nextFocusPath

    Methods inherited from interface com.hrznstudio.titanium.api.client.IScreenAddon

    getTooltipLines, isBackground

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Constructor Details

    • WidgetScreenAddon

      public WidgetScreenAddon(int posX, int posY, net.minecraft.client.gui.components.AbstractWidget widget)
  • Method Details

    • init

      public void init(int screenX, int screenY)
      Description copied from interface: IScreenAddon
      Called when init is called in the screen.
      Parameters:
      screenX - the left point of the Screen
      screenY - the top point of the Screen
    • drawBackgroundLayer

      public void drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
      Description copied from interface: IScreenAddon
      Draws the component in the background layer
      screen - The current open screen
      provider - The current asset provider used in the GUI
      guiX - The gui X in the top left corner
      guiY - The gui Y in the top left corner
      mouseX - The current mouse X
      mouseY - The current mouse Y
      partialTicks - Partial ticks
    • drawForegroundLayer

      public void drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks)
      Description copied from interface: IScreenAddon
      Draws the component in the foreground layer
      screen - The current open screen
      provider - The current asset provider used in the GUI
      guiX - The gui X in the top left corner
      guiY - The gui Y in the top left corner
      mouseX - The current mouse X
      mouseY - The current mouse Y
      partialTicks - Partial Ticks
    • getXSize

      public int getXSize()
      Specified by:
      getXSize in class BasicScreenAddon
    • getYSize

      public int getYSize()
      Specified by:
      getYSize in class BasicScreenAddon
    • mouseMoved

      public void mouseMoved(double xPos, double yPos)
      Description copied from interface: IScreenAddon
      Called when the mouse is moved.
      Parameters:
      xPos - Current mouse coordinate X
      yPos - Current mouse coordinate Y
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Description copied from interface: IScreenAddon
      Called when a mouse button is clicked
      Parameters:
      mouseX - The mouse X coordinate where it was clicked
      mouseY - The mouse Y coordinate where it was clicked
      button - The Id of the button that was clicked
      Returns:
      Returns whether the mouse was clicked successfully or not
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int button)
      Description copied from interface: IScreenAddon
      Called when the mouse button is released
      Parameters:
      mouseX - The Mouse's X coordinate where it was released
      mouseY - The Mouse's Y coordinate where it was released
      button - The Id of the mouse button that was released
      Returns:
      Returns true if the mouse button release was handled
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Description copied from interface: IScreenAddon
      Called when the mouse is pressed and dragged
      Parameters:
      mouseX - The X coordinate of the mouse where the drag was initiated
      mouseY - The Y coordinate of the mouse where the drag was initiated
      button - The Id of the Button that was pressed
      dragX - The X coordinate of the mouse where the drag was finished
      dragY - The Y coordinate of the mouse where the drag was finished
      Returns:
      Returns true if the drag was handled
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double delta)
      Description copied from interface: IScreenAddon
      Called when mouse scroll is applied
      Parameters:
      mouseX - The X coordinate of the mouse where the scroll was initiated
      mouseY - The Y coordinate of the mouse where the scroll was initiated
      delta - The scroll wheel delta (Change rate)
      Returns:
      Returns true if the scroll was handled
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Description copied from interface: IScreenAddon
      Called when a key is pressed
      Parameters:
      keyCode - The keyboard key that was pressed or released
      scanCode - The system-specific scancode of the key
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns true if the key press was handled
    • keyReleased

      public boolean keyReleased(int keyCode, int scanCode, int modifiers)
      Description copied from interface: IScreenAddon
      Called when a key is pressed
      Parameters:
      keyCode - The keyboard key that was pressed or released
      scanCode - The system-specific scancode of the key
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns whether the key release was handled
    • charTyped

      public boolean charTyped(char codePoint, int modifiers)
      Description copied from interface: IScreenAddon
      Called when a specific 'Character' is typed
      Parameters:
      codePoint - The Unicode code point of the character
      modifiers - The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)
      Returns:
      Returns true if the 'Character' being typed was handled
    • isFocused

      public boolean isFocused()
      Specified by:
      isFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
      Specified by:
      isFocused in interface IScreenAddon
      Overrides:
      isFocused in class BasicScreenAddon
    • setFocused

      public void setFocused(boolean focus)
      Description copied from interface: IScreenAddon
      Called when Screen Focus changes
      Specified by:
      setFocused in interface net.minecraft.client.gui.components.events.GuiEventListener
      Specified by:
      setFocused in interface IScreenAddon
      Overrides:
      setFocused in class BasicScreenAddon
      Parameters:
      focus - If the screen the addon is part of is focused
    • isMouseOver

      public boolean isMouseOver(double mouseX, double mouseY)
      Description copied from interface: IScreenAddon
      Checks whether the mouse if over a specific object or point
      Specified by:
      isMouseOver in interface net.minecraft.client.gui.components.events.GuiEventListener
      Specified by:
      isMouseOver in interface IScreenAddon
      Overrides:
      isMouseOver in class BasicScreenAddon
      Parameters:
      mouseX - The X position of the mouse
      mouseY - The Y position of the mouse
      Returns:
      Returns true if the mouse if over a specific object or point
    • getWidget

      public net.minecraft.client.gui.components.AbstractWidget getWidget()