@Environment(value=CLIENT) public abstract class ListWidget extends AbstractParentElement implements Drawable
| Modifier and Type | Field and Description |
|---|---|
protected int |
bottom |
protected boolean |
centerListVertically |
protected MinecraftClient |
client |
protected int |
headerHeight |
protected int |
height |
protected int |
itemHeight |
protected int |
left |
protected boolean |
renderHeader |
protected boolean |
renderSelection |
protected int |
right |
protected double |
scrollAmount |
private boolean |
scrolling |
protected int |
top |
protected boolean |
visible |
protected int |
width |
protected int |
yDrag |
BACKGROUND_TEXTURE, GUI_ICONS_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
ListWidget(MinecraftClient client,
int width,
int height,
int top,
int bottom,
int itemHeight) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
capYPosition() |
boolean |
charTyped(char chr,
int keyCode) |
List<? extends Element> |
children() |
protected void |
clickedHeader(int int2,
int int3) |
int |
getItemAtPosition(double mouseX,
double mouseY) |
protected abstract int |
getItemCount() |
protected int |
getMaxPosition() |
int |
getMaxScroll() |
int |
getRowWidth() |
protected int |
getScrollbarPosition() |
protected boolean |
isFocused() |
boolean |
isMouseInList(double mouseX,
double mouseY) |
boolean |
isMouseOver(double mouseX,
double mouseY) |
protected abstract boolean |
isSelectedItem(int index) |
boolean |
isVisible() |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY) |
boolean |
mouseReleased(double mouseX,
double mouseY,
int button) |
boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount) |
protected void |
moveSelection(int by) |
void |
render(int mouseX,
int mouseY,
float delta) |
protected abstract void |
renderBackground() |
protected void |
renderDecorations(int mouseX,
int mouseY) |
protected void |
renderHeader(int x,
int y,
Tessellator tessellator) |
protected void |
renderHoleBackground(int top,
int bottom,
int topAlpha,
int bottomAlpha) |
protected abstract void |
renderItem(int index,
int x,
int y,
int itemHeight,
int mouseX,
int mouseY,
float delta) |
protected void |
renderList(int x,
int y,
int mouseX,
int mouseY,
float delta) |
protected boolean |
selectItem(int index,
int button,
double mouseX,
double mouseY) |
protected void |
updateItemPosition(int index,
int x,
int y,
float delta) |
protected void |
updateScrollingState(double mouseX,
double mouseY,
int button) |
getFocused, isDragging, setDragging, setFocuseddrawCenteredString, drawHorizontalLine, drawSprite, drawString, drawTexture, drawTexture, drawTexture, drawTexture, drawTexturedQuad, drawVerticalLine, fill, fill, fillGradient, getZOffset, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeFocus, focusOn, hoveredElement, keyReleased, setInitialFocusmouseMovedprotected final MinecraftClient client
protected int width
protected int height
protected int top
protected int bottom
protected int right
protected int left
protected final int itemHeight
protected boolean centerListVertically
protected int yDrag
protected double scrollAmount
protected boolean visible
protected boolean renderSelection
protected boolean renderHeader
protected int headerHeight
private boolean scrolling
public ListWidget(MinecraftClient client, int width, int height, int top, int bottom, int itemHeight)
public boolean isVisible()
protected abstract int getItemCount()
public List<? extends Element> children()
children in interface ParentElementprotected boolean selectItem(int index,
int button,
double mouseX,
double mouseY)
protected abstract boolean isSelectedItem(int index)
protected int getMaxPosition()
protected abstract void renderBackground()
protected void updateItemPosition(int index,
int x,
int y,
float delta)
protected abstract void renderItem(int index,
int x,
int y,
int itemHeight,
int mouseX,
int mouseY,
float delta)
protected void renderHeader(int x,
int y,
Tessellator tessellator)
protected void clickedHeader(int int2,
int int3)
protected void renderDecorations(int mouseX,
int mouseY)
public int getItemAtPosition(double mouseX,
double mouseY)
protected void capYPosition()
public int getMaxScroll()
public boolean isMouseInList(double mouseX,
double mouseY)
public void render(int mouseX,
int mouseY,
float delta)
protected void updateScrollingState(double mouseX,
double mouseY,
int button)
public boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface ElementmouseClicked in interface ParentElementpublic boolean mouseReleased(double mouseX,
double mouseY,
int button)
mouseReleased in interface ElementmouseReleased in interface ParentElementpublic boolean mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
mouseDragged in interface ElementmouseDragged in interface ParentElementpublic boolean mouseScrolled(double mouseX,
double mouseY,
double amount)
mouseScrolled in interface ElementmouseScrolled in interface ParentElementpublic boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface ElementkeyPressed in interface ParentElementprotected void moveSelection(int by)
public boolean charTyped(char chr,
int keyCode)
charTyped in interface ElementcharTyped in interface ParentElementpublic boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface Elementpublic int getRowWidth()
protected void renderList(int x,
int y,
int mouseX,
int mouseY,
float delta)
protected boolean isFocused()
protected int getScrollbarPosition()
protected void renderHoleBackground(int top,
int bottom,
int topAlpha,
int bottomAlpha)