public abstract class GuiComponentScrollBar extends BaseComponent
Modifier and Type | Field and Description |
---|---|
protected int |
currentPosition |
protected int |
height |
protected boolean |
isMoving |
protected int |
maxRange |
protected int |
nubU |
protected int |
nubV |
fontRenderer, keyboardEventListener, mouseEventListener, parent, toolTip, xPos, yPos
Constructor and Description |
---|
GuiComponentScrollBar(GuiBase<?> parent,
int x,
int y,
int nU,
int nV,
int height)
Creates a scroll bar
IMPORTANT: Scroll bar NUB for selected must be to the right of the normal one
NUB should be 12x15 pixels
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentPosition() |
int |
getHeight()
Used to find how tall this is
|
int |
getNubU()
Accessors/Mutators *
|
int |
getNubV() |
int |
getWidth()
Used to find how wide this is
|
boolean |
mouseClicked(double x,
double y,
int button)
Called when the mouse is pressed
|
boolean |
mouseDragged(double x,
double y,
int button,
double xAmount,
double yAmount)
Called when the user drags the component
|
boolean |
mouseReleased(double x,
double y,
int button)
Called when the mouse button is over the component and released
|
protected abstract void |
onScroll(float position)
Called when the scroll box has moved.
|
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 |
setCurrentPosition(float currentPosition) |
void |
setCurrentPosition(int currentPosition) |
void |
setHeight(int height) |
void |
setNubU(int nubU) |
void |
setNubV(int nubV) |
getArea, getDynamicToolTip, getKeyboardEventListener, getMouseEventListener, getParent, getToolTip, getXPos, getYPos, isMouseOver, keyTyped, 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 nubU
protected int nubV
protected int height
protected int maxRange
protected int currentPosition
protected boolean isMoving
public GuiComponentScrollBar(GuiBase<?> parent, int x, int y, int nU, int nV, int height)
parent
- The parent GUIx
- The x posy
- The y posnU
- The nub texture unV
- The nub texture vheight
- The height of this scroll barprotected abstract void onScroll(float position)
position
- The position, 0 - 1 of how far along it ispublic boolean mouseClicked(double x, double y, int button)
x
- Mouse X Positiony
- Mouse Y Positionbutton
- Mouse Buttonpublic boolean mouseDragged(double x, double y, int button, double xAmount, double yAmount)
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 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 getNubU()
public void setNubU(int nubU)
public int getNubV()
public void setNubV(int nubV)
public void setHeight(int height)
public int getCurrentPosition()
public void setCurrentPosition(int currentPosition)
public void setCurrentPosition(float currentPosition)