Record Class PixelIcon
java.lang.Object
java.lang.Record
net.ixdarklord.folios.internal.client.paint.PixelIcon
public record PixelIcon(net.minecraft.resources.Identifier 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.Identifier 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(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int color) The same, straight to the screen.voiddraw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int frame, int color) One of its frames, 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.voidrainbow(GuidePainter painter, int x, int y, float seconds, int base) Drawn inbase, with a rainbow glinting over it now and then: for a second and a half the rainbow fades in, each pixel its own hue, the hues running across it diagonally from its top left to its bottom right and cycling, then fades out, and two seconds later shows again.voidrainbow(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, float seconds, int base) The same, straight to the screen.intsweepFrame(float seconds, float period, float length) The frame of a sweep that plays once everyperiodseconds, takinglengthof them; -1 between sweeps, when nothing is to be drawn.net.minecraft.resources.Identifiertexture()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.Identifier 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
-
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
public void draw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int color) The same, straight to the screen. -
draw
public void draw(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int frame, int color) One of its frames, straight to the screen. -
rainbow
Drawn inbase, with a rainbow glinting over it now and then: for a second and a half the rainbow fades in, each pixel its own hue, the hues running across it diagonally from its top left to its bottom right and cycling, then fades out, and two seconds later shows again. -
rainbow
public void rainbow(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, float seconds, int base) The same, straight to the screen. -
sweepFrame
public int sweepFrame(float seconds, float period, float length) The frame of a sweep that plays once everyperiodseconds, takinglengthof them; -1 between sweeps, when nothing is to be drawn. -
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. -
texture
public net.minecraft.resources.Identifier 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
-