Class PlayerCustomHudWrapper
java.lang.Object
dev.lone.itemsadder.api.FontImages.PlayerHudWrapper
dev.lone.itemsadder.api.FontImages.PlayerQuantityHudWrapper
dev.lone.itemsadder.api.FontImages.PlayerCustomHudWrapper
Wrapper for a custom player HUD that can display a list of font images.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerCustomHudWrapper(PlayerHudsHolderWrapper playerHUDsHolderWrapper, String namespacedID) Creates a custom HUD wrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFontImage(FontImageWrapper fontImageWrapper) Adds a font image at the end of the HUD image list.voidaddFontImageToIndex(FontImageWrapper fontImageWrapper, int index) Adds a font image at a specific index.voidRemoves all font images and recalculates HUD offsets.intGets the amount of font images displayed by this HUD.voidremoveFontImageByIndex(int index) Removes a font image by index.voidsetFontImages(List<FontImageWrapper> fontImageWrappers) Replaces all font images displayed by this HUD.Methods inherited from class PlayerQuantityHudWrapper
getFloatValue, setFloatValueMethods inherited from class PlayerHudWrapper
exists, getInitialOffsetX, getNamespacedID, getOffsetX, isVisible, setOffsetX, setVisible
-
Constructor Details
-
PlayerCustomHudWrapper
Creates a custom HUD wrapper.- Parameters:
playerHUDsHolderWrapper- the player's HUD holder wrapper.namespacedID- the HUD namespaced id.
-
-
Method Details
-
clearFontImagesAndRefresh
public void clearFontImagesAndRefresh()Removes all font images and recalculates HUD offsets. -
setFontImages
Replaces all font images displayed by this HUD.- Parameters:
fontImageWrappers- the new font images.
-
removeFontImageByIndex
public void removeFontImageByIndex(int index) Removes a font image by index.- Parameters:
index- the image index.
-
addFontImageToIndex
Adds a font image at a specific index.- Parameters:
fontImageWrapper- the font image wrapper.index- the insertion index.
-
addFontImage
Adds a font image at the end of the HUD image list.- Parameters:
fontImageWrapper- the font image wrapper.
-
getFontImagesCount
public int getFontImagesCount()Gets the amount of font images displayed by this HUD.- Returns:
- the font image count.
-