Class UtilKt

  • All Implemented Interfaces:

    
    public final class UtilKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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

      • 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.

      • loadImage

         final static <Error class: unknown class> loadImage(String name)

        Load an image.

      • loadFont

         final static <Error class: unknown class> loadFont(String name)

        A convenience function to load a custom font from resources.

      • toRadians

         final static Double toRadians(Integer $self)

        Don't know if this will be useful anywhere else, but is used a lot in graphics.