public class GuiTab extends BaseComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.List<BaseComponent> |
children |
protected int |
currentHeight |
protected int |
currentWidth |
protected int |
dHeight |
protected int |
dWidth |
protected int |
expandedHeight |
protected int |
expandedWidth |
protected static int |
FOLDED_SIZE |
protected boolean |
isActive |
protected net.minecraft.client.renderer.ItemRenderer |
itemRenderer |
protected net.minecraft.item.ItemStack |
stack |
protected NinePatchRenderer |
tabRenderer |
protected int |
u |
protected int |
v |
fontRenderer, keyboardEventListener, mouseEventListener, parent, toolTip, xPos, yPos
Constructor and Description |
---|
GuiTab(GuiBase<?> parent,
int x,
int y,
int u,
int v,
int exWidth,
int exHeight,
net.minecraft.item.ItemStack displayStack)
Creates a Gui Tab
IMPORTANT: Texture should be a full nine patch renderer minus the left column of cells
See NinePatchRenderer construction for more info
|
Modifier and Type | Method and Description |
---|---|
GuiTab |
addChild(BaseComponent component)
Add a child to this tab
|
boolean |
areChildrenActive()
Can the tab render the children
|
java.util.List<BaseComponent> |
getChildren() |
int |
getHeight()
Used to find how tall this is
|
net.minecraft.item.ItemStack |
getStack() |
int |
getU()
Accessors/Mutators *
|
int |
getV() |
int |
getWidth()
Used to find how wide this is
|
boolean |
isActive() |
void |
keyTyped(char letter,
int keyCode)
Used when a key is pressed
|
boolean |
mouseDownActivated(double x,
double y,
int button)
Called when the mouse is pressed
We are broken this out as GuiTabCollection will pass down
|
boolean |
mouseDragActivated(double x,
double y,
int button,
double xAmount,
double yAmount)
Called when the user drags the component
We are broken this out as GuiTabCollection will pass down
|
void |
mouseScrolledTab(int dir)
Called by the GuiTabCollection when the mouse scrolls
|
boolean |
mouseUpActivated(double x,
double y,
int button)
Called when the mouse button is over the component and released
We are broken this out as GuiTabCollection will pass down
|
void |
moveSlots()
Moves the slots if need be
|
void |
render(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called to render the component
|
void |
renderOverlay(int guiLeft,
int guiTop,
int mouseX,
int mouseY)
Called after base render, is already translated to guiLeft and guiTop, just move offset
|
void |
renderToolTip(int mouseX,
int mouseY)
Render the tooltip if you can
|
void |
setActive(boolean active) |
void |
setChildren(java.util.List<BaseComponent> children) |
void |
setStack(net.minecraft.item.ItemStack stack) |
void |
setU(int u) |
void |
setV(int v) |
getArea, getDynamicToolTip, getKeyboardEventListener, getMouseEventListener, getParent, getToolTip, getXPos, getYPos, isMouseOver, mouseDown, mouseDrag, mouseScrolled, mouseUp, setKeyboardEventListener, setMouseEventListener, setParent, setToolTip, setXPos, setYPos
addButton, children, getMinecraft, getNarrationMessage, getTitle, getTooltipFromItem, handleComponentClicked, hasAltDown, hasControlDown, hasShiftDown, init, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onClose, removed, render, renderBackground, renderBackground, renderComponentHoverEffect, renderDirtBackground, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, setSize, shouldCloseOnEsc, tick, wrapScreenError
getFocused, isDragging, setDragging, setFocused
blit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fillGradient, hLine, innerBlit, vLine
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static final int FOLDED_SIZE
protected int expandedWidth
protected int expandedHeight
protected int u
protected int v
protected net.minecraft.item.ItemStack stack
protected int currentWidth
protected int currentHeight
protected int dWidth
protected int dHeight
protected boolean isActive
protected java.util.List<BaseComponent> children
protected NinePatchRenderer tabRenderer
protected net.minecraft.client.renderer.ItemRenderer itemRenderer
public GuiTab(GuiBase<?> parent, int x, int y, int u, int v, int exWidth, int exHeight, @Nullable net.minecraft.item.ItemStack displayStack)
parent
- The parent GUIx
- The x posy
- The y posu
- The texture u, this is the middle top cell for the nine patch rendererv
- The texture v, this is the middle top cell for the nine patch rendererexWidth
- The expanded widthexHeight
- The expanded heightdisplayStack
- The stack to displaypublic GuiTab addChild(BaseComponent component)
component
- The component to addpublic boolean areChildrenActive()
public void moveSlots()
public boolean mouseDownActivated(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean mouseUpActivated(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean mouseDragActivated(double x, double y, int button, double xAmount, double yAmount)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic void mouseScrolledTab(int dir)
dir
- The scroll dirpublic void keyTyped(char letter, int keyCode)
keyTyped
in class BaseComponent
letter
- The letterkeyCode
- The codepublic void renderToolTip(int mouseX, int mouseY)
renderToolTip
in class BaseComponent
mouseX
- Mouse XmouseY
- Mouse Ypublic void render(int guiLeft, int guiTop, int mouseX, int mouseY)
render
in class BaseComponent
public void renderOverlay(int guiLeft, int guiTop, int mouseX, int mouseY)
renderOverlay
in class BaseComponent
public int getWidth()
getWidth
in class BaseComponent
public int getHeight()
getHeight
in class BaseComponent
public int getU()
public void setU(int u)
public int getV()
public void setV(int v)
public net.minecraft.item.ItemStack getStack()
public void setStack(net.minecraft.item.ItemStack stack)
public java.util.List<BaseComponent> getChildren()
public void setChildren(java.util.List<BaseComponent> children)
public boolean isActive()
public void setActive(boolean active)