public class UISelect.OptionsContainer extends UIComponent<UISelect.OptionsContainer> implements IScrollable, IClipable
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate| Modifier and Type | Field and Description |
|---|---|
protected GuiIconProvider |
iconsExpanded
Icon used to draw the option container.
|
protected GuiShape |
optionBackground
Shape used to draw the hovered
UISelect.Option background |
protected int |
optionOffset
The option offset for the
UIScrollBar. |
protected GuiShape |
optionsShape
Shape used to draw the
options box |
protected UISlimScrollbar |
scrollbar
The
UIScrollBar used by this UISelect.OptionsContainer. |
| Constructor and Description |
|---|
OptionsContainer(MalisisGui gui) |
| Modifier and Type | Method and Description |
|---|---|
void |
drawBackground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called first when drawing this
UIComponent. |
void |
drawForeground(GuiRenderer renderer,
int mouseX,
int mouseY,
float partialTick)
Called last when drawing this
UIComponent. |
int |
getBottomPadding()
Gets the padding for the bottom.
|
ClipArea |
getClipArea()
Gets
ClipArea to be used for glScissor |
int |
getContentHeight()
Gets the height of the scrollable content.
|
int |
getContentWidth()
Gets the width of the scrollable content.
|
int |
getHeight()
Gets the height of this
UIComponent. |
int |
getLeftPadding()
Gets the padding for the left.
|
float |
getOffsetX()
Gets the offset from 0 to 1 of the scrollable content.
|
float |
getOffsetY()
Gets the offset from 0 to 1 of the scrollable content.
|
protected UISelect.Option<T> |
getOptionAt(int mouseX,
int mouseY)
Gets the
UISelect.Option at the speicfied coordinates. |
int |
getRightPadding()
Gets the padding for the right.
|
float |
getScrollStep()
Gets the amount of scrolling from 0 to 1, done by one step of the scroll wheel.
|
int |
getTopPadding()
Gets the padding for the top.
|
int |
getWidth()
Gets the width of this
UIComponent. |
boolean |
onClick(int x,
int y)
On click.
|
boolean |
onKeyTyped(char keyChar,
int keyCode)
Called when a key is typed inside
MalisisGui. |
void |
setClipContent(boolean clip)
Sets whether this
IClipable should clip or not. |
void |
setOffsetX(float offsetX,
int delta)
Sets the offset from 0 to 1 of the scrollable content.
|
void |
setOffsetY(float offsetY,
int delta)
Sets the offset from 0 to 1 of the scrollable content.
|
boolean |
shouldClipContent()
Checks whether this
IClipable should clip or not. |
addControlComponent, attachData, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getData, getGui, getIconProvider, getName, getParent, getPropertyString, getRawHeight, getRawWidth, getRenderer, getTooltip, getX, getY, getZIndex, isEnabled, isFocused, isHovered, isInsideBounds, isRelativeHeight, isRelativeWidth, isVisible, onAddedToScreen, onButtonPress, onButtonRelease, onDoubleClick, onDrag, onMouseMove, onRightClick, onScrollWheel, parentX, parentY, register, relativeX, relativeY, removeAllControlComponents, removeControlComponent, screenX, screenY, self, setAlpha, setAnchor, setEnabled, setFocused, setHovered, setName, setParent, setPosition, setPosition, setSize, setTooltip, setTooltip, setVisible, setZIndex, toString, unregisterprotected UISlimScrollbar scrollbar
UIScrollBar used by this UISelect.OptionsContainer.protected int optionOffset
UIScrollBar.protected GuiShape optionBackground
UISelect.Option backgroundprotected GuiIconProvider iconsExpanded
public OptionsContainer(MalisisGui gui)
public int getWidth()
UIComponentUIComponent.getWidth in interface IClipablegetWidth in class UIComponent<UISelect.OptionsContainer>public int getHeight()
UIComponentUIComponent.getHeight in interface IClipablegetHeight in class UIComponent<UISelect.OptionsContainer>protected UISelect.Option<T> getOptionAt(int mouseX, int mouseY)
UISelect.Option at the speicfied coordinates.mouseX - the mouse xmouseY - the mouse ypublic int getContentHeight()
IScrollablegetContentHeight in interface IScrollablepublic int getContentWidth()
IScrollablegetContentWidth in interface IScrollablepublic float getOffsetX()
IScrollableUIScrollBar.Type.HORIZONTAL scrollbars.getOffsetX in interface IScrollablepublic void setOffsetX(float offsetX,
int delta)
IScrollableUIScrollBar.Type.HORIZONTAL scrollbars.UIScrollBar.Type.VERTICAL scrollbar if available.setOffsetX in interface IScrollableoffsetX - the offset xdelta - the deltapublic float getOffsetY()
IScrollableUIScrollBar.Type.VERTICAL scrollbars.getOffsetY in interface IScrollablepublic void setOffsetY(float offsetY,
int delta)
IScrollableUIScrollBar.Type.VERTICAL scrollbars.UIScrollBar.Type.HORIZONTAL scrollbar if available.setOffsetY in interface IScrollableoffsetY - the offset ydelta - the deltapublic float getScrollStep()
IScrollablegetScrollStep in interface IScrollablepublic int getLeftPadding()
IScrollablegetLeftPadding in interface IScrollablepublic int getRightPadding()
IScrollablegetRightPadding in interface IScrollablepublic int getTopPadding()
IScrollablegetTopPadding in interface IScrollablepublic int getBottomPadding()
IScrollablegetBottomPadding in interface IScrollablepublic void drawBackground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponentUIComponent.drawBackground in class UIComponent<UISelect.OptionsContainer>renderer - the renderermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic void drawForeground(GuiRenderer renderer, int mouseX, int mouseY, float partialTick)
UIComponentUIComponent.drawForeground in class UIComponent<UISelect.OptionsContainer>renderer - the renderermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic boolean onClick(int x,
int y)
UIComponentonClick in class UIComponent<UISelect.OptionsContainer>x - the xy - the ypublic boolean onKeyTyped(char keyChar,
int keyCode)
IKeyListenerMalisisGui.onKeyTyped in interface IKeyListeneronKeyTyped in class UIComponent<UISelect.OptionsContainer>keyChar - the key charkeyCode - the key codepublic ClipArea getClipArea()
IClipableClipArea to be used for glScissorgetClipArea in interface IClipablepublic void setClipContent(boolean clip)
IClipableIClipable should clip or not.setClipContent in interface IClipableclip - the new clip contentpublic boolean shouldClipContent()
IClipableIClipable should clip or not.shouldClipContent in interface IClipable