Record Class PixelIcon
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.paint.PixelIcon
public record PixelIcon(net.minecraft.resources.ResourceLocation texture, int width, int height, int frames)
extends Record
One of the books' small pixel-art icons: a white image (its softer pixels part see-through), drawn at its own size,
a pixel to a pixel, tinted with the colour it is drawn in. Read from assets/folios/textures/gui/icons/, so a
resource pack can redraw any of them (kept the same size). An icon with frames is a flipbook: its frames stacked
top to bottom in the one image, each
width by height.-
Constructor Summary
ConstructorsConstructorDescriptionPixelIcon(net.minecraft.resources.ResourceLocation texture, int width, int height, int frames) Creates an instance of aPixelIconrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(GuidePainter painter, int x, int y, int color) Draws it with its top left at (x, y), in the colour given.voiddraw(GuidePainter painter, int x, int y, int frame, int color) Draws one of its frames (0 for the top one).voiddraw(GuiGraphicsExtractor graphics, int x, int y, int color) The same, straight to the screen.final booleanIndicates whether some other object is "equal to" this one.intframes()Returns the value of theframesrecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.static PixelIconstatic PixelIconA flipbook offramesframes, stacked top to bottom.net.minecraft.resources.ResourceLocationtexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
PixelIcon
public PixelIcon(net.minecraft.resources.ResourceLocation texture, int width, int height, int frames) Creates an instance of aPixelIconrecord class.- Parameters:
texture- the value for thetexturerecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentframes- the value for theframesrecord component
-
-
Method Details
-
of
-
of
A flipbook offramesframes, stacked top to bottom. -
draw
Draws it with its top left at (x, y), in the colour given. -
draw
Draws one of its frames (0 for the top one). -
draw
The same, straight to the screen. -
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 '=='. -
texture
public net.minecraft.resources.ResourceLocation texture()Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
frames
public int frames()Returns the value of theframesrecord component.- Returns:
- the value of the
framesrecord component
-