Package xyz.gmitch215.socketmc.screen.ui
Class ImageButton
java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
xyz.gmitch215.socketmc.screen.ui.AbstractButton
xyz.gmitch215.socketmc.screen.ui.ImageButton
- All Implemented Interfaces:
- Serializable,- LayoutElement,- Positionable
Represents a button that displays an image.
- See Also:
- 
Field SummaryFields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractButtonBIG_WIDTH, DEFAULT_HEIGHT, DEFAULT_SPACING, DEFAULT_WIDTH, SMALL_WIDTHFields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidgetDEFAULT_PADDING, height, tooltip, width, x, y
- 
Constructor SummaryConstructorsConstructorDescriptionImageButton(int x, int y, int width, int height, @NotNull Sprite sprite) Constructs a new button with an empty message.ImageButton(int x, int y, int width, int height, @NotNull Sprite sprite, @NotNull String messageJSON) Constructs a new button.ImageButton(int x, int y, int width, int height, @NotNull Sprite sprite, @NotNull Text message) Constructs a new button.ImageButton(int x, int y, @NotNull Sprite sprite) Constructs a new button using the default dimesions and an empty message.ImageButton(int x, int y, @NotNull Sprite sprite, @NotNull Text message) Constructs a new button using the default dimesions.
- 
Method SummaryMethods inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractTextWidgetequals, getMessageJSON, setMessage, setMessageJSONMethods inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidgetclearListeners, getHeight, getListeners, getTooltip, getWidth, getX, getY, hashCode, onClick, setHeight, setTooltip, setWidth, setX, setY, toString, visitWidgetsMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface xyz.gmitch215.socketmc.screen.layout.LayoutElementsetPosition, setSize, setSize, setSizeMethods inherited from interface xyz.gmitch215.socketmc.screen.PositionableinSamePosition
- 
Constructor Details- 
ImageButtonConstructs a new button using the default dimesions and an empty message.- Parameters:
- x- the x-coordinate
- y- the y-coordinate
- sprite- the sprite
- Throws:
- IllegalArgumentException- if coordinates are negative, or sprite is null
 
- 
ImageButtonpublic ImageButton(int x, int y, int width, int height, @NotNull @NotNull Sprite sprite) throws IllegalArgumentException Constructs a new button with an empty message.- Parameters:
- x- the x-coordinate
- y- the y-coordinate
- width- the width
- height- the height
- sprite- the sprite
- Throws:
- IllegalArgumentException- if coordinates or dimensions are negative, or sprite is null
 
- 
ImageButtonpublic ImageButton(int x, int y, @NotNull @NotNull Sprite sprite, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new button using the default dimesions.- Parameters:
- x- the x-coordinate
- y- the y-coordinate
- sprite- the sprite
- message- the message
- Throws:
- IllegalArgumentException- if coordinates are negative, or message/sprite is null
 
- 
ImageButtonpublic ImageButton(int x, int y, int width, int height, @NotNull @NotNull Sprite sprite, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new button.- Parameters:
- x- the x-coordinate
- y- the y-coordinate
- width- the width
- height- the height
- sprite- the sprite
- message- the message
- Throws:
- IllegalArgumentException- if coordinates or dimensions are negative, or sprite is null
 
- 
ImageButtonpublic ImageButton(int x, int y, int width, int height, @NotNull @NotNull Sprite sprite, @NotNull @NotNull String messageJSON) throws IllegalArgumentException Constructs a new button.- Parameters:
- x- the x-coordinate
- y- the y-coordinate
- width- the width
- height- the height
- sprite- the sprite
- messageJSON- the message in JSON format
- Throws:
- IllegalArgumentException- if coordinates or dimensions are negative, or sprite is null
 
 
- 
- 
Method Details- 
getSpriteGets the sprite for this button.- Returns:
- the sprite
 
- 
setSpriteSets the sprite for this button.- Parameters:
- sprite- the sprite
- Throws:
- IllegalArgumentException- if sprite is null
 
 
-