Package noppes.npcs.api.gui
Interface IScroll
-
- All Superinterfaces:
ICustomGuiComponent
public interface IScroll extends ICustomGuiComponent
Represents a scrollable list component in a custom GUI. Provides methods to control size, selection, and the displayed list.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getDefaultSelection()
Returns the default selection index.int
getHeight()
Returns the height of the scroll component.java.lang.String[]
getList()
Returns the list of text entries displayed in the scroll.int
getWidth()
Returns the width of the scroll component.boolean
isMultiSelect()
Checks whether multiple selections are allowed.IScroll
setDefaultSelection(int defaultSelection)
Sets the default selection index.IScroll
setList(java.lang.String[] textList)
Sets the list of text entries to display.IScroll
setMultiSelect(boolean selectMultiple)
Sets whether multiple selections are allowed.IScroll
setSize(int width, int height)
Sets the size of the scroll component.-
Methods inherited from interface noppes.npcs.api.gui.ICustomGuiComponent
fromNBT, getAlpha, getColor, getHoverText, getID, getPosX, getPosY, getRotation, hasHoverText, setAlpha, setColor, setHoverText, setHoverText, setID, setPos, setRotation, toNBT
-
-
-
-
Method Detail
-
getWidth
int getWidth()
Returns the width of the scroll component.- Returns:
- the width in pixels.
-
getHeight
int getHeight()
Returns the height of the scroll component.- Returns:
- the height in pixels.
-
setSize
IScroll setSize(int width, int height)
Sets the size of the scroll component.- Parameters:
width
- the new width.height
- the new height.- Returns:
- this scroll instance.
-
getList
java.lang.String[] getList()
Returns the list of text entries displayed in the scroll.- Returns:
- an array of strings.
-
setList
IScroll setList(java.lang.String[] textList)
Sets the list of text entries to display.- Parameters:
textList
- an array of strings.- Returns:
- this scroll instance.
-
getDefaultSelection
int getDefaultSelection()
Returns the default selection index.- Returns:
- the default selection.
-
setDefaultSelection
IScroll setDefaultSelection(int defaultSelection)
Sets the default selection index.- Parameters:
defaultSelection
- the selection index.- Returns:
- this scroll instance.
-
isMultiSelect
boolean isMultiSelect()
Checks whether multiple selections are allowed.- Returns:
- true if multi-select is enabled.
-
setMultiSelect
IScroll setMultiSelect(boolean selectMultiple)
Sets whether multiple selections are allowed.- Parameters:
selectMultiple
- true to allow multi-select.- Returns:
- this scroll instance.
-
-