Class Shaper.CircleShape
java.lang.Object
ActiverseUtils.Shaper.CircleShape
- Enclosing class:
Shaper
Represents a circle shape configuration.
- Version:
- 1.4.1
- Author:
- Knivier
-
Constructor Summary
ConstructorsConstructorDescriptionCircleShape(int diameter) Creates a circle shape with the specified diameter. -
Method Summary
Modifier and TypeMethodDescriptiongetBoundingBox(int x, int y) Creates a bounding box rectangle for collision detection.intGets the diameter of the circle.Gets the fill color.Gets the outline color.intGets the outline width.voidPaints the circle on the given graphics context at the specified position.withFillColor(Color color) Sets the fill color of the circle.withOutlineColor(Color color) Sets the outline color of the circle.withOutlineWidth(int width) Sets the outline width of the circle.
-
Constructor Details
-
CircleShape
public CircleShape(int diameter) Creates a circle shape with the specified diameter.- Parameters:
diameter- The diameter of the circle
-
-
Method Details
-
withFillColor
Sets the fill color of the circle.- Parameters:
color- The color to fill the circle with- Returns:
- This CircleShape instance for method chaining
-
withOutlineColor
Sets the outline color of the circle.- Parameters:
color- The color for the circle outline- Returns:
- This CircleShape instance for method chaining
-
withOutlineWidth
Sets the outline width of the circle.- Parameters:
width- The width of the outline in pixels- Returns:
- This CircleShape instance for method chaining
-
getDiameter
public int getDiameter()Gets the diameter of the circle.- Returns:
- The diameter
-
getFillColor
-
getOutlineColor
Gets the outline color.- Returns:
- The outline color, or null if not set
-
getOutlineWidth
public int getOutlineWidth()Gets the outline width.- Returns:
- The outline width
-
paint
Paints the circle on the given graphics context at the specified position.- Parameters:
g- The graphics context to draw onx- The x-coordinate of the circle (top-left corner of bounding box)y- The y-coordinate of the circle (top-left corner of bounding box)
-
getBoundingBox
Creates a bounding box rectangle for collision detection.- Parameters:
x- The x-coordinate of the circley- The y-coordinate of the circle- Returns:
- A Rectangle representing the bounding box
-