Class Shaper

java.lang.Object
ActiverseUtils.Shaper

public class Shaper extends Object
Utility class for creating and managing shapes for actors. Provides convenient methods to build rectangles, circles, and other shapes without requiring images.
Version:
1.4.1
Author:
Knivier
  • Constructor Details

    • Shaper

      public Shaper()
  • Method Details

    • rectangle

      public static Shaper.RectangleShape rectangle(int width, int height)
      Creates a new rectangle shape with the specified dimensions.
      Parameters:
      width - The width of the rectangle
      height - The height of the rectangle
      Returns:
      A RectangleShape instance
    • rectangleScaled

      public static Shaper.RectangleShape rectangleScaled(int originalWidth, int originalHeight, double scaleFactor)
      Creates a new rectangle shape with dimensions scaled from an original size. Useful for making shapes longer/wider by a percentage.
      Parameters:
      originalWidth - The original width
      originalHeight - The original height
      scaleFactor - The scale factor (e.g., 1.1 for 10% larger)
      Returns:
      A RectangleShape instance with scaled dimensions
    • square

      public static Shaper.RectangleShape square(int sideLength)
      Creates a new square shape with the specified side length.
      Parameters:
      sideLength - The length of each side
      Returns:
      A RectangleShape instance
    • circle

      public static Shaper.CircleShape circle(int diameter)
      Creates a new circle shape with the specified diameter.
      Parameters:
      diameter - The diameter of the circle
      Returns:
      A CircleShape instance
    • circleFromRadius

      public static Shaper.CircleShape circleFromRadius(int radius)
      Creates a new circle shape with diameter calculated from radius.
      Parameters:
      radius - The radius of the circle
      Returns:
      A CircleShape instance