public class UISelect.OptionsContainer extends UIComponent<UISelect.OptionsContainer> implements IScrollable
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 |
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 |
getHorizontalPadding()
Gets the horizontal padding.
|
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. |
float |
getScrollStep()
Gets the amount of scrolling from 0 to 1, done by one step of the scroll wheel.
|
int |
getVerticalPadding()
Gets the vertical padding.
|
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 |
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.
|
addControlComponent, attachData, componentX, componentY, draw, fireEvent, getAlpha, getAnchor, getComponentAt, getData, getGui, getIconProvider, getName, getParent, getPropertyString, getRawHeight, getRawWidth, getRenderer, getTooltip, getX, getY, getZIndex, isDisabled, 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, setDisabled, 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 class UIComponent<UISelect.OptionsContainer>public int getHeight()
UIComponentUIComponent.getHeight 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 getVerticalPadding()
IScrollablegetVerticalPadding in interface IScrollablepublic int getHorizontalPadding()
IScrollablegetHorizontalPadding 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 code