Record Class Font.TextureGlyph
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.resource.asset.Font.TextureGlyph
- Record Components:
name- The name of the glyph used for tag resolution, or null if unnamed.fontId- The key identifier of the font.texture- The texture used by the glyph.character- The unicode character.height- The pixel height.ascent- The pixel ascent.
- All Implemented Interfaces:
Font.Glyph
- Enclosing class:
Font
public static record Font.TextureGlyph(@Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull Texture texture, char character, int height, int ascent)
extends Record
implements Font.Glyph
A glyph from a bitmap texture.
-
Constructor Summary
ConstructorsConstructorDescriptionTextureGlyph(@Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull Texture texture, char character, int height, int ascent) Creates an instance of aTextureGlyphrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintascent()Returns the value of theascentrecord component.charReturns the value of thecharacterrecord component.final booleanIndicates whether some other object is "equal to" this one.net.kyori.adventure.key.KeyfontId()Returns the value of thefontIdrecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.@Nullable Stringname()Returns the value of thenamerecord component.@NotNull Texturetexture()Returns the value of thetexturerecord component.net.kyori.adventure.text.TextComponentConverts this glyph to a TextComponent.Converts this glyph to a MiniMessage string format.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TextureGlyph
public TextureGlyph(@Nullable @Nullable String name, net.kyori.adventure.key.Key fontId, @NotNull @NotNull Texture texture, char character, int height, int ascent) Creates an instance of aTextureGlyphrecord class.- Parameters:
name- the value for thenamerecord componentfontId- the value for thefontIdrecord componenttexture- the value for thetexturerecord componentcharacter- the value for thecharacterrecord componentheight- the value for theheightrecord componentascent- the value for theascentrecord component
-
-
Method Details
-
toComponent
public net.kyori.adventure.text.TextComponent toComponent()Converts this glyph to a TextComponent.- Returns:
- The representing TextComponent.
-
toMiniMessageString
Converts this glyph to a MiniMessage string format.- Returns:
- The formatted MiniMessage string.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
fontId
public net.kyori.adventure.key.Key fontId()Returns the value of thefontIdrecord component.- Returns:
- the value of the
fontIdrecord component
-
texture
Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
character
public char character()Returns the value of thecharacterrecord component.- Returns:
- the value of the
characterrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
ascent
public int ascent()Returns the value of theascentrecord component.- Returns:
- the value of the
ascentrecord component
-