io.github.espressoengine.object.Circle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of espresso Show documentation
Show all versions of espresso Show documentation
A simple and lightweight game engine for Java using Swing.
The newest version!
package io.github.espressoengine.object;
import io.github.espressoengine.Vector2;
import java.awt.geom.*;
/**
* Mesh2D with circle geometry.
*
* @author pastthepixels
* @version $Id: $Id
*/
public class Circle extends Mesh2D {
public Vector2 size = new Vector2(36, 36);
public Ellipse2D _geometry = new Ellipse2D.Double(_enginePosition.x, _enginePosition.y, size.x, size.y);
/** {@inheritDoc} */
public void updateGeometry() {
this._geometry.setFrame(_enginePosition.x, _enginePosition.y, size.x, size.y);
this.geometry = this._geometry;
}
/**
* Sets the radius of the circle.
*
* @param radius a double
*/
public void setRadius(double radius) {
size.set(radius, radius);
}
}