public class Button extends Component implements TextComponent
Constructor and Description |
---|
Button()
Creates a button with default text.
|
Button(float x,
float y,
float width,
float height)
Creates a button with default text and specified position and size.
|
Button(java.lang.String text)
Creates a button with specified text.
|
Button(java.lang.String text,
float x,
float y,
float width,
float height)
Creates a button with specified text and specified position and size.
|
Button(java.lang.String text,
org.joml.Vector2f position,
org.joml.Vector2f size)
Creates a button with specified text and specified position and size.
|
Button(org.joml.Vector2f position,
org.joml.Vector2f size)
Creates a button with default text and specified position and size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Icon |
getBackgroundIcon()
Returns background image.
|
Icon |
getFocusedBackgroundIcon()
Returns focused background image.
|
Icon |
getHoveredBackgroundIcon()
Returns hovered background image.
|
Icon |
getPressedBackgroundIcon()
Returns pressed background image.
|
TextState |
getTextState()
Returns text data of button.
|
int |
hashCode() |
void |
setBackgroundIcon(Icon backgroundIcon)
Used to change background image.
|
void |
setFocusedBackgroundIcon(Icon focusedBackgroundIcon)
Used to change focused background image.
|
void |
setHoveredBackgroundIcon(Icon hoveredBackgroundIcon)
Used to change hovered background image.
|
void |
setPressedBackgroundIcon(Icon pressedBackgroundIcon)
Used to change pressed background image.
|
java.lang.String |
toString() |
add, addAll, clearChilds, containerIterator, contains, containsAll, count, forEach, getAbsolutePosition, getBackgroundColor, getBorder, getChilds, getCornerRadius, getFocusedStrokeColor, getIntersector, getListenerMap, getMetadata, getParent, getPosition, getSize, getTooltip, intersects, isEmpty, isEnabled, isFocused, isHovered, isPressed, isVisible, parallelStream, remove, removeAll, removeIf, setBackgroundColor, setBackgroundColor, setBorder, setCornerRadius, setEnabled, setFocused, setFocusedStrokeColor, setFocusedStrokeColor, setHovered, setIntersector, setListenerMap, setParent, setPosition, setPosition, setPressed, setSize, setSize, setTooltip, setVisible, stream
public Button()
public Button(float x, float y, float width, float height)
x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public Button(org.joml.Vector2f position, org.joml.Vector2f size)
position
- position in parent.size
- size of component.public Button(java.lang.String text)
text
- button text.public Button(java.lang.String text, float x, float y, float width, float height)
text
- button text.x
- x position in parent.y
- y position in parent.width
- width of component.height
- height of component.public Button(java.lang.String text, org.joml.Vector2f position, org.joml.Vector2f size)
text
- button text.position
- position in parent.size
- size of component.public TextState getTextState()
getTextState
in interface TextComponent
public Icon getBackgroundIcon()
public void setBackgroundIcon(Icon backgroundIcon)
backgroundIcon
- background image.public Icon getFocusedBackgroundIcon()
public void setFocusedBackgroundIcon(Icon focusedBackgroundIcon)
focusedBackgroundIcon
- focused background image.public Icon getPressedBackgroundIcon()
public void setPressedBackgroundIcon(Icon pressedBackgroundIcon)
pressedBackgroundIcon
- pressed background image.public Icon getHoveredBackgroundIcon()
public void setHoveredBackgroundIcon(Icon hoveredBackgroundIcon)
hoveredBackgroundIcon
- hovered background image.