Name | Type | Default | Description |
---|---|---|---|
x | number | 0 | optional |
y | number | 0 | optional |
width | number | 0 | optional |
height | number | 0 | optional |
Example
Example usage of Rectangle.
// new Rectangle
const {Rectangle} = next2d.geom;
const rectangle = new Rectangle(0, 0, 100, 100);
Members
指定されたクラスの空間名を返します。
Returns the space name of the specified class.- Default Value:
- next2d.geom.Rectangle
y プロパティと height プロパティの合計です。
The sum of the y and height properties.Rectangle オブジェクトの右下隅の位置で、
right プロパティと bottom プロパティの値で決まります。
The location of the Rectangle object's bottom-right corner,
determined by the values of the right and bottom properties.矩形の高さ(ピクセル単位)です。
The height of the rectangle, in pixels.矩形の左上隅の x 座標です。
The x coordinate of the top-left corner of the rectangle.指定されたオブジェクトの空間名を返します。
Returns the space name of the specified object.- Default Value:
- next2d.geom.Rectangle
x プロパティと width プロパティの合計です。
The sum of the x and width properties.Rectangle オブジェクトのサイズで、
width プロパティと height プロパティの値を持つ Point オブジェクトとして表現されます。
The size of the Rectangle object,
expressed as a Point object with the values of the width and height properties.矩形の左上隅の y 座標です。
The y coordinate of the top-left corner of the rectangle.Rectangle オブジェクトの左上隅の位置で、
そのポイントの x 座標と y 座標で決まります。
The location of the Rectangle object's top-left corner,
determined by the x and y coordinates of the point.矩形の幅(ピクセル単位)です。
The width of the rectangle, in pixels.矩形の左上隅の x 座標です。
The x coordinate of the top-left corner of the rectangle.矩形の左上隅の y 座標です。
The y coordinate of the top-left corner of the rectangle.
Methods
指定されたクラスのストリングを返します。
Returns the string representation of the specified class.- Default Value:
- [class Rectangle]
Returns:
Type Description string 元の Rectangle オブジェクトと x、y、width、および height の各プロパティの値が同じである、
新しい Rectangle オブジェクトを返します。
Returns a new Rectangle object with the same values for the x, y, width,
and height properties as the original Rectangle object.Returns:
Type Description Rectangle 指定されたポイントがこの Rectangle オブジェクトで定義される矩形領域内にあるかどうかを判別します。
Determines whether the specified point is contained within
the rectangular region defined by this Rectangle object.Name Type Description x
number y
number Returns:
Type Description boolean 指定されたポイントがこの Rectangle オブジェクトで定義される矩形領域内にあるかどうかを判別します。
Determines whether the specified point is contained within
the rectangular region defined by this Rectangle object.Name Type Description point
Point Returns:
Type Description boolean rect パラメーターで指定された Rectangle オブジェクトがこの Rectangle オブジェクト内にあるかどうかを判別します。
Determines whether the Rectangle object specified by
the rect parameter is contained within this Rectangle object.Name Type Description rect
Rectangle Returns:
Type Description boolean すべての矩形データを、ソース Rectangle オブジェクトから、
呼び出し元の Rectangle オブジェクトにコピーします。
Copies all of rectangle data from
the source Rectangle object into the calling Rectangle object.Name Type Description source_rect
Rectangle Returns:
Type Description void toCompare パラメーターで指定されたオブジェクトが
この Rectangle オブジェクトと等しいかどうかを判別します。
Determines whether the object specified
in the toCompare parameter is equal to this Rectangle object.Name Type Description to_compare
Rectangle Returns:
Type Description boolean Rectangle オブジェクトのサイズを、指定された量(ピクセル単位)だけ大きくします。
Increases the size of the Rectangle object by the specified amounts, in pixels.Name Type Description dx
number dy
number Returns:
voidRectangle オブジェクトのサイズを大きくします。
Increases the size of the Rectangle object.Name Type Description point
Point Returns:
Type Description void toIntersect パラメーターで指定された Rectangle オブジェクトが
この Rectangle オブジェクトと交差する場合に、交差領域を Rectangle オブジェクトとして返します。
If the Rectangle object specified in the toIntersect parameter intersects
with this Rectangle object, returns the area of intersection as a Rectangle object.Name Type Description to_intersect
Rectangle Returns:
Type Description Rectangle toIntersect パラメーターで指定されたオブジェクトが
この Rectangle オブジェクトと交差するかどうかを判別します。
Determines whether the object specified
in the toIntersect parameter intersects with this Rectangle object.Name Type Description to_intersect
Rectangle Returns:
Type Description boolean この Rectangle オブジェクトが空かどうかを判別します。
Determines whether or not this Rectangle object is empty.Returns:
Type Description boolean Rectangle オブジェクトの位置(左上隅で決定される)を、指定された量だけ調整します。
Adjusts the location of the Rectangle object,
as determined by its top-left corner, by the specified amounts.Name Type Description dx
number dy
number Returns:
Type Description void Point オブジェクトをパラメーターとして使用して、Rectangle オブジェクトの位置を調整します。
Adjusts the location of the Rectangle object using a Point object as a parameter.Name Type Description point
Point Returns:
Type Description void Rectangle オブジェクトのすべてのプロパティを 0 に設定します。
Sets all of the Rectangle object's properties to 0.Returns:
Type Description void Rectangle のメンバーを指定の値に設定します。
Sets the members of Rectangle to the specified valuesName Type Description x
number y
number width
number height
number Returns:
Type Description void 指定されたオブジェクトのストリングを返します。
Returns the string representation of the specified object.Returns:
Type Description string 2 つの矩形間の水平と垂直の空間を塗りつぶすことにより、
2 つの矩形を加算して新しい Rectangle オブジェクトを作成します。
Adds two rectangles together to create a new Rectangle object,
by filling in the horizontal and vertical space between the two rectangles.Name Type Description to_union
Rectangle Returns:
Type Description Rectangle