Class IconWidget
java.lang.Object
net.glasslauncher.mods.api.gcapi.screen.widget.IconWidget
- All Implemented Interfaces:
HasDrawable,HasToolTip
- Direct Known Subclasses:
ResetConfigWidget
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(int mouseX, int mouseY) Use this to render your drawable on the screen.The tooltip to show, can be multiline by adding another element onto the list.int[]getXYWH()The position and size of your element.voidkeyPressed(char character, int key) Called whenever a key is pressed.voidmouseClicked(int mouseX, int mouseY, int button) Note: This is called any time the mouse is clicked.voidsetID(int id) Called when the config category is adding the drawable.voidsetXYWH(int x, int y, int width, int height) Called when setting the drawable position.voidtick()Called every frame.
-
Field Details
-
x
public int x -
y
public int y -
width
public int width -
height
public int height -
icon
-
-
Constructor Details
-
IconWidget
-
-
Method Details
-
draw
public void draw(int mouseX, int mouseY) Description copied from interface:HasDrawableUse this to render your drawable on the screen.- Specified by:
drawin interfaceHasDrawable
-
mouseClicked
public void mouseClicked(int mouseX, int mouseY, int button) Description copied from interface:HasDrawableNote: This is called any time the mouse is clicked. Check the button ID if you want to only do stuff with your button.- Specified by:
mouseClickedin interfaceHasDrawable
-
setXYWH
public void setXYWH(int x, int y, int width, int height) Description copied from interface:HasDrawableCalled when setting the drawable position. X and Y is the top left corner.- Specified by:
setXYWHin interfaceHasDrawable
-
tick
public void tick()Description copied from interface:HasDrawableCalled every frame.- Specified by:
tickin interfaceHasDrawable
-
keyPressed
public void keyPressed(char character, int key) Description copied from interface:HasDrawableCalled whenever a key is pressed.- Specified by:
keyPressedin interfaceHasDrawable
-
setID
public void setID(int id) Description copied from interface:HasDrawableCalled when the config category is adding the drawable.- Specified by:
setIDin interfaceHasDrawable
-
getTooltip
Description copied from interface:HasToolTipThe tooltip to show, can be multiline by adding another element onto the list.- Specified by:
getTooltipin interfaceHasToolTip- Returns:
- a List of colour-enabled strings to use as a tooltip.
-
getXYWH
public int[] getXYWH()Description copied from interface:HasToolTipThe position and size of your element. Required.- Specified by:
getXYWHin interfaceHasToolTip- Returns:
- a 4 length array of ints, the X position, Y position, width and height of your element.
-