public abstract class GuiComponentSetNumber extends BaseComponent
Modifier and Type | Field and Description |
---|---|
protected int |
ceiling |
protected boolean |
downSelected |
protected int |
floor |
protected int |
height |
protected net.minecraft.client.gui.widget.TextFieldWidget |
textField |
protected int |
u |
protected boolean |
upSelected |
protected int |
v |
protected int |
value |
protected int |
width |
fontRenderer, keyboardEventListener, mouseEventListener, parent, toolTip, xPos, yPos
Constructor and Description |
---|
GuiComponentSetNumber(GuiBase<?> parent,
int x,
int y,
int texU,
int texV,
int value,
int lowestValue,
int highestValue)
Creates the set number object
IMPORTANT: You must create the up and down arrow and pass the u and v or the top left corner
It should look like the following in the texture sheet:
UN|US
DN|DS
With UN and DN being the normal up and down and US and DS being the selected versions (when clicked)
The arrow buttons should be 11x8 pixels and all touching to form one big rectangle
|
Modifier and Type | Method and Description |
---|---|
int |
getCeiling() |
int |
getFloor() |
int |
getHeight()
Used to find how tall this is
|
net.minecraft.client.gui.widget.TextFieldWidget |
getTextField() |
int |
getU() |
int |
getV() |
int |
getValue() |
int |
getWidth()
Used to find how wide this is
|
void |
keyTyped(char letter,
int keyCode)
Used when a key is pressed
|
boolean |
mouseClicked(double x,
double y,
int button)
Called when the mouse is pressed
|
boolean |
mouseReleased(double x,
double y,
int button)
Called when the mouse button is over the component and released
|
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 |
setCeiling(int ceiling) |
void |
setFloor(int floor) |
void |
setTextField(net.minecraft.client.gui.widget.TextFieldWidget textField) |
void |
setU(int u) |
void |
setV(int v) |
protected abstract void |
setValue(int value)
Called when the user sets the value or when the value is changed
|
void |
setWidth(int width)
Accessors/Mutators *
|
getArea, getDynamicToolTip, getKeyboardEventListener, getMouseEventListener, getParent, getToolTip, getXPos, getYPos, isMouseOver, mouseDown, mouseDrag, mouseScrolled, mouseUp, renderToolTip, 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 int width
protected int u
protected int v
protected int value
protected int floor
protected int ceiling
protected int height
protected net.minecraft.client.gui.widget.TextFieldWidget textField
protected boolean upSelected
protected boolean downSelected
public GuiComponentSetNumber(GuiBase<?> parent, int x, int y, int texU, int texV, int value, int lowestValue, int highestValue)
parent
- The parent GUIx
- The x posy
- The y postexU
- The texture u locationtexV
- The texture v locationvalue
- The starting valuelowestValue
- The lowest valuehighestValue
- The highest valueprotected abstract void setValue(int value)
value
- The value set by the userpublic boolean mouseClicked(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean mouseReleased(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic void keyTyped(char letter, int keyCode)
keyTyped
in class BaseComponent
letter
- The letterkeyCode
- The codepublic 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 void setWidth(int width)
public int getU()
public void setU(int u)
public int getV()
public void setV(int v)
public int getValue()
public int getFloor()
public void setFloor(int floor)
public int getCeiling()
public void setCeiling(int ceiling)
public net.minecraft.client.gui.widget.TextFieldWidget getTextField()
public void setTextField(net.minecraft.client.gui.widget.TextFieldWidget textField)