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
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
name
-
fontId
-
texture
-
character
-
height
-
ascent
-