Package crackers.kobots.graphics
Class UtilKt
-
- All Implemented Interfaces:
public final class UtilKt
-
-
Method Summary
Modifier and Type Method Description final static <Error class: unknown class>
center(FontMetrics $self, String text, Integer width)
Use font metrics to center some text horizontally in an area final static Integer
middle(FontMetrics $self, Integer verticalHeight)
Use font metrics to center some text vertically in an area. final static Integer
baseline(FontMetrics $self, Integer row, Integer lineSpacing)
Use font metrics to get where the baseline of a line would be, with optional spacing. final static <Error class: unknown class>
loadImage(String name)
Load an image. final static <Error class: unknown class>
loadFont(String name)
A convenience function to load a custom font from resources. final static Polygon
plus(Polygon $self, Pair<Integer, Integer> v)
Function to easily add points to a polygon in a chainable function. final static Double
toRadians(Integer $self)
Don't know if this will be useful anywhere else, but is used a lot in graphics. final static Font
fitFont(Graphics2D $self, Font f, Integer h)
Fits a font to a specified number of pixels. -
-
Method Detail
-
center
final static <Error class: unknown class> center(FontMetrics $self, String text, Integer width)
Use font metrics to center some text horizontally in an area
-
middle
final static Integer middle(FontMetrics $self, Integer verticalHeight)
Use font metrics to center some text vertically in an area.
-
baseline
final static Integer baseline(FontMetrics $self, Integer row, Integer lineSpacing)
Use font metrics to get where the baseline of a line would be, with optional spacing. Assumes row is zero-based.
-
loadFont
final static <Error class: unknown class> loadFont(String name)
A convenience function to load a custom font from resources.
-
plus
final static Polygon plus(Polygon $self, Pair<Integer, Integer> v)
Function to easily add points to a polygon in a chainable function.
-
toRadians
final static Double toRadians(Integer $self)
Don't know if this will be useful anywhere else, but is used a lot in graphics.
-
fitFont
final static Font fitFont(Graphics2D $self, Font f, Integer h)
Fits a font to a specified number of pixels.
-
-
-
-