简体   繁体   English

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

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

I´m wondering how a circle is positioned. 我想知道圆形的位置。 For example the X-/Y-Coordinates of an rectangle are in the bottom left corner of itself. 例如,矩形的X / Y坐标位于其左下角。 But how does it work with a circle? 但是它如何与圆一起工作? ~Henri 〜亨利

Rectangle position(X and Y coordinate) defined by bottom-left corner of itself. Rectangle位置(X和Y坐标)由其左下角定义。

But in case of Circle there is no corner or any such parameter. 但是在Circle情况下,没有角或任何此类参数。 Circle having center(X and Y coordinate) and radius. 具有中心(X和Y坐标)和半径的圆。

If we construct a circle with default constructor 如果我们用默认构造函数构造一个圆

Circle circle=new Circle();     

In this case x,y and radius all are zero, so circle center is at at bottom-left of the screen with radius zero. 在这种情况下,x,y和半径都为零,因此圆心位于屏幕的左下角,半径为零。

X/Y coordinates of circle is it's center. 圆的X / Y坐标为中心。

Here is one of circle's constuctors. 这是圈子的构造者之一。

/** 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