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
-
Field Summary
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsConstructorDescriptionWidgetScreenAddon(int posX, int posY, net.minecraft.client.gui.components.AbstractWidget widget) -
Method Summary
Modifier and TypeMethodDescriptionbooleanchangeFocus(boolean focus) Called when Screen Focus changesbooleancharTyped(char codePoint, int modifiers) Called when a specific 'Character' is typedvoiddrawBackgroundLayer(com.mojang.blaze3d.vertex.PoseStack stack, 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 layervoiddrawForegroundLayer(com.mojang.blaze3d.vertex.PoseStack stack, 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 layernet.minecraft.client.gui.components.AbstractWidgetintgetXSize()intgetYSize()voidinit(int screenX, int screenY) Called when init is called in the screen.booleanisMouseOver(double mouseX, double mouseY) Checks whether the mouse if over a specific object or pointbooleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a key is pressedbooleankeyReleased(int keyCode, int scanCode, int modifiers) Called when a key is pressedbooleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clickedbooleanmouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is pressed and draggedvoidmouseMoved(double xPos, double yPos) Called when the mouse is moved.booleanmouseReleased(double mouseX, double mouseY, int button) Called when the mouse button is releasedbooleanmouseScrolled(double mouseX, double mouseY, double delta) Called when mouse scroll is appliedMethods inherited from class com.hrznstudio.titanium.client.screen.addon.BasicScreenAddon
getPosX, getPosY, setPosX, setPosYMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hrznstudio.titanium.api.client.IScreenAddon
getTooltipLines, isBackground
-
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:IScreenAddonCalled when init is called in the screen.- Parameters:
screenX- the left point of the ScreenscreenY- the top point of the Screen
-
drawBackgroundLayer
public void drawBackgroundLayer(com.mojang.blaze3d.vertex.PoseStack stack, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Description copied from interface:IScreenAddonDraws the component in the background layer- Parameters:
stack- ThePoseStackscreen- The current open screenprovider- The current asset provider used in the GUIguiX- The gui X in the top left cornerguiY- The gui Y in the top left cornermouseX- The current mouse XmouseY- The current mouse YpartialTicks- Partial ticks
-
drawForegroundLayer
public void drawForegroundLayer(com.mojang.blaze3d.vertex.PoseStack stack, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Description copied from interface:IScreenAddonDraws the component in the foreground layer- Parameters:
stack- ThePoseStackscreen- The current open screenprovider- The current asset provider used in the GUIguiX- The gui X in the top left cornerguiY- The gui Y in the top left cornermouseX- The current mouse XmouseY- The current mouse YpartialTicks- Partial Ticks
-
getXSize
public int getXSize()- Specified by:
getXSizein classBasicScreenAddon
-
getYSize
public int getYSize()- Specified by:
getYSizein classBasicScreenAddon
-
mouseMoved
public void mouseMoved(double xPos, double yPos) Description copied from interface:IScreenAddonCalled when the mouse is moved.- Parameters:
xPos- Current mouse coordinate XyPos- Current mouse coordinate Y
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) Description copied from interface:IScreenAddonCalled when a mouse button is clicked- Parameters:
mouseX- The mouse X coordinate where it was clickedmouseY- The mouse Y coordinate where it was clickedbutton- 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:IScreenAddonCalled when the mouse button is released- Parameters:
mouseX- The Mouse's X coordinate where it was releasedmouseY- The Mouse's Y coordinate where it was releasedbutton- 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:IScreenAddonCalled when the mouse is pressed and dragged- Parameters:
mouseX- The X coordinate of the mouse where the drag was initiatedmouseY- The Y coordinate of the mouse where the drag was initiatedbutton- The Id of the Button that was presseddragX- The X coordinate of the mouse where the drag was finisheddragY- 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:IScreenAddonCalled when mouse scroll is applied- Parameters:
mouseX- The X coordinate of the mouse where the scroll was initiatedmouseY- The Y coordinate of the mouse where the scroll was initiateddelta- 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:IScreenAddonCalled when a key is pressed- Parameters:
keyCode- The keyboard key that was pressed or releasedscanCode- The system-specific scancode of the keymodifiers- 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:IScreenAddonCalled when a key is pressed- Parameters:
keyCode- The keyboard key that was pressed or releasedscanCode- The system-specific scancode of the keymodifiers- 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:IScreenAddonCalled when a specific 'Character' is typed- Parameters:
codePoint- The Unicode code point of the charactermodifiers- The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)- Returns:
- Returns true if the 'Character' being typed was handled
-
changeFocus
public boolean changeFocus(boolean focus) Description copied from interface:IScreenAddonCalled when Screen Focus changes- Parameters:
focus- If the screen the addon is part of is focused- Returns:
- Returns true if the widget is part of a focused screen
-
isMouseOver
public boolean isMouseOver(double mouseX, double mouseY) Description copied from interface:IScreenAddonChecks whether the mouse if over a specific object or point- Specified by:
isMouseOverin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Specified by:
isMouseOverin interfaceIScreenAddon- Overrides:
isMouseOverin classBasicScreenAddon- Parameters:
mouseX- The X position of the mousemouseY- 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()
-