Class Shaper
java.lang.Object
ActiverseUtils.Shaper
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a circle shape configuration.static classRepresents a rectangle shape configuration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Shaper.CircleShapecircle(int diameter) Creates a new circle shape with the specified diameter.static Shaper.CircleShapecircleFromRadius(int radius) Creates a new circle shape with diameter calculated from radius.static Shaper.RectangleShaperectangle(int width, int height) Creates a new rectangle shape with the specified dimensions.static Shaper.RectangleShaperectangleScaled(int originalWidth, int originalHeight, double scaleFactor) Creates a new rectangle shape with dimensions scaled from an original size.static Shaper.RectangleShapesquare(int sideLength) Creates a new square shape with the specified side length.
-
Constructor Details
-
Shaper
public Shaper()
-
-
Method Details
-
rectangle
Creates a new rectangle shape with the specified dimensions.- Parameters:
width- The width of the rectangleheight- 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 widthoriginalHeight- The original heightscaleFactor- The scale factor (e.g., 1.1 for 10% larger)- Returns:
- A RectangleShape instance with scaled dimensions
-
square
Creates a new square shape with the specified side length.- Parameters:
sideLength- The length of each side- Returns:
- A RectangleShape instance
-
circle
Creates a new circle shape with the specified diameter.- Parameters:
diameter- The diameter of the circle- Returns:
- A CircleShape instance
-
circleFromRadius
Creates a new circle shape with diameter calculated from radius.- Parameters:
radius- The radius of the circle- Returns:
- A CircleShape instance
-