繁体   English   中英

LibGDX:圆的X / Y坐标在哪里?

[英]LibGDX: Where is the X-/Y-Coordinate of a circle?

我想知道圆形的位置。 例如,矩形的X / Y坐标位于其左下角。 但是它如何与圆一起工作? 〜亨利

Rectangle位置(X和Y坐标)由其左下角定义。

但是在Circle情况下,没有角或任何此类参数。 具有中心(X和Y坐标)和半径的圆。

如果我们用默认构造函数构造一个圆

Circle circle=new Circle();     

在这种情况下,x,y和半径都为零,因此圆心位于屏幕的左下角,半径为零。

圆的X / Y坐标为中心。

这是圈子的构造者之一。

/** Constructs a new circle with the given X and Y coordinates and the given radius.
 * 
 * @param x X coordinate
 * @param y Y coordinate
 * @param radius The radius of the circle */
public Circle (float x, float y, float radius) {
    this.x = x;
    this.y = y;
    this.radius = radius;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM