Package de.gurkenlabs.litiengine.gui
Class Menu
java.lang.Object
de.gurkenlabs.litiengine.gui.GuiComponent
de.gurkenlabs.litiengine.gui.ImageComponentList
de.gurkenlabs.litiengine.gui.Menu
- All Implemented Interfaces:
IRenderable
,Tweenable
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
public class Menu
extends ImageComponentList
The Class Menu.
Field Summary
Constructor Summary
Constructors Constructor Description Menu(double x, double y, double width, double height, Spritesheet background, java.lang.String... items)
Menu(double x, double y, double width, double height, java.lang.String... items)
Method Summary
Modifier and Type Method Description int
getCurrentSelection()
void
onChange(java.util.function.IntConsumer cons)
void
prepare()
Prepare the GuiComponent and all its child Components (Makes the GuiComponent visible and adds mouse listeners.).void
setCurrentSelection(int currentSelection)
Methods inherited from class de.gurkenlabs.litiengine.gui.ImageComponentList
createNewEntry, getBackground, getCellComponents, getColumns, getColumnWidth, getImages, getRowHeight, getRows, setColumnWidth, setRowHeight, setXOffset, setYOffset
Methods inherited from class de.gurkenlabs.litiengine.gui.GuiComponent
drawTextShadow, getAppearance, getAppearanceDisabled, getAppearanceHovered, getBoundingBox, getClickConsumer, getComponentId, getComponents, getCurrentAppearance, getFont, getHeight, getHoverConsumer, getHoverSound, getLocation, getMouseDraggedConsumer, getMouseEnterConsumer, getMouseLeaveConsumer, getMouseMovedConsumer, getMousePressedConsumer, getMouseReleasedConsumer, getMouseWheelConsumer, getName, getShape, getTag, getText, getTextAlign, getTextAngle, getTextShadowColor, getTextShadowStroke, getTextToRender, getTextValign, getTextX, getTextY, getTweenValues, getWidth, getX, getY, hasAutomaticLineBreaks, hasTextAntialiasing, 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, render, setAutomaticLineBreaks, setDimension, setEnabled, setFont, setFontSize, setForwardMouseEvents, setHeight, setHovered, setHoverSound, setLocation, setLocation, setName, setSelected, setTag, setText, setTextAlign, setTextAngle, setTextAntialiasing, setTextShadow, setTextShadowColor, setTextShadowStroke, setTextValign, setTextX, setTextY, setTweenValues, setVisible, setWidth, setX, setY, suspend, toggleSelection, toggleSuspension
Constructor Details
Menu
public Menu(double x, double y, double width, double height, java.lang.String... items)Menu
public Menu(double x, double y, double width, double height, Spritesheet background, java.lang.String... items)
Method Details
getCurrentSelection
public int getCurrentSelection()onChange
public void onChange(java.util.function.IntConsumer cons)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 classImageComponentList
setCurrentSelection
public void setCurrentSelection(int currentSelection)