Package net.uku3lig.ukulib.utils
Class IconButton
java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.Button
net.uku3lig.ukulib.utils.IconButton
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.Renderable,net.minecraft.client.gui.components.TabOrderedElement,net.minecraft.client.gui.layouts.LayoutElement,net.minecraft.client.gui.narration.NarratableEntry,net.minecraft.client.gui.narration.NarrationSupplier
@Deprecated(since="1.10.0",
forRemoval=true)
public class IconButton
extends net.minecraft.client.gui.components.Button
Deprecated, for removal: This API element is subject to removal in a future version.
A simple button with an icon. Works best when the button is square.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.components.Button
net.minecraft.client.gui.components.Button.Builder, net.minecraft.client.gui.components.Button.CreateNarration, net.minecraft.client.gui.components.Button.OnPress, net.minecraft.client.gui.components.Button.PlainNested classes/interfaces inherited from class net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessageNested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry
net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority -
Field Summary
Fields inherited from class net.minecraft.client.gui.components.Button
BIG_WIDTH, createNarration, DEFAULT_HEIGHT, DEFAULT_NARRATION, DEFAULT_SPACING, DEFAULT_WIDTH, onPress, SMALL_WIDTHFields inherited from class net.minecraft.client.gui.components.AbstractButton
TEXT_MARGINFields inherited from class net.minecraft.client.gui.components.AbstractWidget
active, alpha, height, isHovered, message, visible, width -
Constructor Summary
ConstructorsConstructorDescriptionIconButton(int x, int y, int width, int height, net.minecraft.resources.Identifier texture, int u, int v, int iconWidth, int iconHeight, int textureWidth, int textureHeight, net.minecraft.client.gui.components.Button.OnPress pressAction) Deprecated, for removal: This API element is subject to removal in a future version.Makes a new button with a centered icon.IconButton(int x, int y, int width, int height, net.minecraft.resources.Identifier texture, int textureWidth, int textureHeight, net.minecraft.client.gui.components.Button.OnPress pressAction) Deprecated, for removal: This API element is subject to removal in a future version.Makes a new button with a centered icon. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.The height of the iconintDeprecated, for removal: This API element is subject to removal in a future version.The width of the iconnet.minecraft.resources.IdentifierDeprecated, for removal: This API element is subject to removal in a future version.The texture of the iconintDeprecated, for removal: This API element is subject to removal in a future version.The height of the textureintDeprecated, for removal: This API element is subject to removal in a future version.The width of the textureintgetU()Deprecated, for removal: This API element is subject to removal in a future version.The x position of the icon in the textureintgetV()Deprecated, for removal: This API element is subject to removal in a future version.The y position of the icon in the textureprotected voidrenderContents(@NotNull net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float deltaTicks) Deprecated, for removal: This API element is subject to removal in a future version.voidsetIconHeight(int iconHeight) Deprecated, for removal: This API element is subject to removal in a future version.The height of the iconvoidsetIconWidth(int iconWidth) Deprecated, for removal: This API element is subject to removal in a future version.The width of the iconvoidsetTexture(net.minecraft.resources.Identifier texture) Deprecated, for removal: This API element is subject to removal in a future version.The texture of the iconvoidsetTextureHeight(int textureHeight) Deprecated, for removal: This API element is subject to removal in a future version.The height of the texturevoidsetTextureWidth(int textureWidth) Deprecated, for removal: This API element is subject to removal in a future version.The width of the texturevoidsetU(int u) Deprecated, for removal: This API element is subject to removal in a future version.The x position of the icon in the texturevoidsetV(int v) Deprecated, for removal: This API element is subject to removal in a future version.The y position of the icon in the textureMethods inherited from class net.minecraft.client.gui.components.Button
builder, createNarrationMessage, onPress, updateWidgetNarrationMethods inherited from class net.minecraft.client.gui.components.AbstractButton
keyPressed, onClick, renderDefaultLabel, renderDefaultSprite, renderWidget, setOverrideRenderHighlightedSpriteMethods inherited from class net.minecraft.client.gui.components.AbstractWidget.WithInactiveMessage
defaultInactiveMessage, getMessage, setMessageMethods inherited from class net.minecraft.client.gui.components.AbstractWidget
defaultButtonNarrationText, getAlpha, getBottom, getHeight, getRectangle, getRight, getTabOrderGroup, getWidth, getX, getY, handleCursor, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playButtonClickSound, playDownSound, render, renderScrollingStringOverContents, setAlpha, setFocused, setHeight, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
charTyped, getBorderForArrowNavigation, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled, shouldTakeFocusAfterInteractionMethods inherited from interface net.minecraft.client.gui.layouts.LayoutElement
setPositionMethods inherited from interface net.minecraft.client.gui.narration.NarratableEntry
getNarratables
-
Constructor Details
-
IconButton
public IconButton(int x, int y, int width, int height, net.minecraft.resources.Identifier texture, int u, int v, int iconWidth, int iconHeight, int textureWidth, int textureHeight, net.minecraft.client.gui.components.Button.OnPress pressAction) Deprecated, for removal: This API element is subject to removal in a future version.Makes a new button with a centered icon.- Parameters:
x- The x position of the buttony- The y position of the buttonwidth- The width of the buttonheight- The height of the buttontexture- The texture of the iconu- The x position of the icon in the texturev- The y position of the icon in the textureiconWidth- The width of the iconiconHeight- The height of the icontextureWidth- The width of the texturetextureHeight- The height of the texturepressAction- The action to perform when the button is pressed
-
IconButton
public IconButton(int x, int y, int width, int height, net.minecraft.resources.Identifier texture, int textureWidth, int textureHeight, net.minecraft.client.gui.components.Button.OnPress pressAction) Deprecated, for removal: This API element is subject to removal in a future version.Makes a new button with a centered icon. The rendered icon will be the whole texture.- Parameters:
x- The x position of the buttony- The y position of the buttonwidth- The width of the buttonheight- The height of the buttontexture- The texture of the icontextureWidth- The width of the texturetextureHeight- The height of the texturepressAction- The action to perform when the button is pressed
-
-
Method Details
-
renderContents
protected void renderContents(@NotNull @NotNull net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float deltaTicks) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
renderContentsin classnet.minecraft.client.gui.components.AbstractButton
-
getTexture
public net.minecraft.resources.Identifier getTexture()Deprecated, for removal: This API element is subject to removal in a future version.The texture of the icon- Returns:
- The texture
-
getU
public int getU()Deprecated, for removal: This API element is subject to removal in a future version.The x position of the icon in the texture- Returns:
- The x position
-
getV
public int getV()Deprecated, for removal: This API element is subject to removal in a future version.The y position of the icon in the texture- Returns:
- The y position
-
getIconWidth
public int getIconWidth()Deprecated, for removal: This API element is subject to removal in a future version.The width of the icon- Returns:
- The width
-
getIconHeight
public int getIconHeight()Deprecated, for removal: This API element is subject to removal in a future version.The height of the icon- Returns:
- The height
-
getTextureWidth
public int getTextureWidth()Deprecated, for removal: This API element is subject to removal in a future version.The width of the texture- Returns:
- The width
-
getTextureHeight
public int getTextureHeight()Deprecated, for removal: This API element is subject to removal in a future version.The height of the texture- Returns:
- The height
-
setTexture
public void setTexture(net.minecraft.resources.Identifier texture) Deprecated, for removal: This API element is subject to removal in a future version.The texture of the icon- Parameters:
texture- The new texture
-
setU
public void setU(int u) Deprecated, for removal: This API element is subject to removal in a future version.The x position of the icon in the texture- Parameters:
u- The new x position
-
setV
public void setV(int v) Deprecated, for removal: This API element is subject to removal in a future version.The y position of the icon in the texture- Parameters:
v- The new y position
-
setIconWidth
public void setIconWidth(int iconWidth) Deprecated, for removal: This API element is subject to removal in a future version.The width of the icon- Parameters:
iconWidth- The new width
-
setIconHeight
public void setIconHeight(int iconHeight) Deprecated, for removal: This API element is subject to removal in a future version.The height of the icon- Parameters:
iconHeight- The new height
-
setTextureWidth
public void setTextureWidth(int textureWidth) Deprecated, for removal: This API element is subject to removal in a future version.The width of the texture- Parameters:
textureWidth- The new width
-
setTextureHeight
public void setTextureHeight(int textureHeight) Deprecated, for removal: This API element is subject to removal in a future version.The height of the texture- Parameters:
textureHeight- The new height
-
ImageButtoninstead.