Package de.gurkenlabs.litiengine.gui
Class ImageComponentList
java.lang.Object
de.gurkenlabs.litiengine.gui.GuiComponent
de.gurkenlabs.litiengine.gui.ImageComponentList
- All Implemented Interfaces:
IRenderable,Tweenable,MouseListener,MouseMotionListener,MouseWheelListener,EventListener
- Direct Known Subclasses:
Menu
Represents a list of image components in a GUI. This class provides functionality to manage and display a list of image components.
-
Field Summary
Fields inherited from class de.gurkenlabs.litiengine.gui.GuiComponent
ICON_FONT -
Constructor Summary
ConstructorsConstructorDescriptionImageComponentList(double x, double y, double width, double height, int rows, int columns, List<Image> images, Spritesheet background) -
Method Summary
Modifier and TypeMethodDescriptionprotected ImageComponentcreateNewEntry(double x, double y, double width, double height, Spritesheet spritesheet, String text, Image image) Creates a new image component entry.Gets the background spritesheet of the image component list.Gets the list of image components (cells) in the image component list.intGets the number of columns in the image component list.doubleGets the width of each column in the image component list.Gets the list of images in the image component list.doubleGets the height of each row in the image component list.intgetRows()Gets the number of rows in the image component list.voidprepare()Prepare the GuiComponent and all its child Components (Makes the GuiComponent visible and adds mouse listeners.).voidsetColumnWidth(double columnWidth) Sets the width of each column in the image component list.voidsetRowHeight(double rowHeight) Sets the height of each row in the image component list.voidsetXOffset(double xOffset) Sets the horizontal offset for the image component list.voidsetYOffset(double yOffset) Sets the vertical offset for the image component list.Methods inherited from class de.gurkenlabs.litiengine.gui.GuiComponent
addRenderedListener, addRenderListener, getAppearance, getAppearanceDisabled, getAppearanceHovered, getBoundingBox, getCenterX, getCenterY, getClickConsumer, getComponentId, getComponents, getCurrentAppearance, getFont, getHeight, getHoverConsumer, getHoverSound, getLocation, getMouseDraggedConsumer, getMouseEnterConsumer, getMouseLeaveConsumer, getMouseMovedConsumer, getMousePressedConsumer, getMouseReleasedConsumer, getMouseWheelConsumer, getName, getShape, getTag, getText, getTextAlign, getTextAngle, getTextShadowColor, getTextShadowRadius, getTextToRender, getTextValign, getTextX, getTextY, getTweenValues, getWidth, getX, getY, hasAutomaticLineBreaks, hasTextAntialiasing, hasTextShadow, initializeComponents, isEnabled, isForwardMouseEvents, isHovered, isPressed, isSelected, isSuspended, isVisible, mouseClicked, mouseDragged, mouseEntered, mouseEventShouldBeForwarded, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, onClicked, onHovered, onMouseDragged, onMouseEnter, onMouseLeave, onMouseMoved, onMousePressed, onMouseReleased, onMouseWheelScrolled, onTextChanged, removeListener, removeListener, render, setAutomaticLineBreaks, setDimension, setEnabled, setFont, setFontSize, setForwardMouseEvents, setHeight, setHovered, setHoverSound, setLocation, setLocation, setName, setSelected, setTag, setText, setTextAlign, setTextAngle, setTextAntialiasing, setTextShadow, setTextShadowColor, setTextShadowRadius, setTextValign, setTextX, setTextY, setTweenValues, setVisible, setWidth, setX, setY, suspend, toggleSelection, toggleSuspension
-
Constructor Details
-
ImageComponentList
public ImageComponentList(double x, double y, double width, double height, int rows, int columns, List<Image> images, Spritesheet background)
-
-
Method Details
-
getBackground
Gets the background spritesheet of the image component list.- Returns:
- The background spritesheet.
-
getCellComponents
Gets the list of image components (cells) in the image component list.- Returns:
- The list of image components.
-
getColumns
public int getColumns()Gets the number of columns in the image component list.- Returns:
- The number of columns.
-
getImages
Gets the list of images in the image component list.- Returns:
- The list of images.
-
getRows
public int getRows()Gets the number of rows in the image component list.- Returns:
- The number of rows.
-
prepare
public void prepare()Description copied from class:GuiComponentPrepare the GuiComponent and all its child Components (Makes the GuiComponent visible and adds mouse listeners.). This is, for example, done right before switching to a new screen.- Overrides:
preparein classGuiComponent
-
getRowHeight
public double getRowHeight()Gets the height of each row in the image component list.- Returns:
- The height of each row.
-
setRowHeight
public void setRowHeight(double rowHeight) Sets the height of each row in the image component list.- Parameters:
rowHeight- The height to set for each row.
-
getColumnWidth
public double getColumnWidth()Gets the width of each column in the image component list.- Returns:
- The width of each column.
-
setColumnWidth
public void setColumnWidth(double columnWidth) Sets the width of each column in the image component list.- Parameters:
columnWidth- The width to set for each column.
-
setXOffset
public void setXOffset(double xOffset) Sets the horizontal offset for the image component list.- Parameters:
xOffset- The horizontal offset to set.
-
setYOffset
public void setYOffset(double yOffset) Sets the vertical offset for the image component list.- Parameters:
yOffset- The vertical offset to set.
-
createNewEntry
protected ImageComponent createNewEntry(double x, double y, double width, double height, Spritesheet spritesheet, String text, Image image) Creates a new image component entry.- Parameters:
x- The x-coordinate of the new entry.y- The y-coordinate of the new entry.width- The width of the new entry.height- The height of the new entry.spritesheet- The spritesheet to be used for the new entry.text- The text to be displayed on the new entry.image- The image to be displayed on the new entry.- Returns:
- The newly created image component.
-