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

public class ImageComponentList extends GuiComponent
Represents a list of image components in a GUI. This class provides functionality to manage and display a list of image components.
  • 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

      public Spritesheet getBackground()
      Gets the background spritesheet of the image component list.
      Returns:
      The background spritesheet.
    • getCellComponents

      public List<ImageComponent> 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

      public List<Image> 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: GuiComponent
      Prepare 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:
      prepare in class GuiComponent
    • 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.