#Ellipse
继承自ShapePrimitive

The Ellipse object is used to help draw graphics and can also be used to specify a hit area for containers.

总览

构造函数

#Cconstructor
签名
Ellipse(x: number, y: number, halfWidth: number, halfHeight: number): Ellipse
参数
x: number

The X coordinate of the center of this ellipse

参数
y: number

The Y coordinate of the center of this ellipse

参数
halfWidth: number

The half width of this ellipse

参数
halfHeight: number

The half height of this ellipse

返回Ellipse

属性

#PhalfHeight

The half height of this ellipse

@default
0
签名number
#PhalfWidth

The half width of this ellipse

@default
0
签名number
#Ptype只读

The type of the object, mainly used to avoid instanceof checks

@default
'ellipse'
签名"ellipse"
#Px

The X coordinate of the center of this ellipse

@default
0
签名number
#Py

The Y coordinate of the center of this ellipse

@default
0
签名number

方法

#Mbuild
签名
build(points: number[], screenScale: number): number[]
描述

The Y coordinate of the shape

参数
points: number[]
参数
screenScale: number
返回number[]
#Mclone
签名
clone(): Ellipse
描述

Creates a clone of this Ellipse instance

@returns

A copy of the ellipse

返回Ellipse
#Mcontains
签名
contains(x: number, y: number): boolean
描述

Checks whether the x and y coordinates given are contained within this ellipse

@returns

Whether the x/y coords are within this ellipse

参数
x: number

The X coordinate of the point to test

参数
y: number

The Y coordinate of the point to test

返回boolean
#McopyFrom
签名
copyFrom(ellipse: Ellipse): this
描述

Copies another ellipse to this one.

@returns

Returns itself.

参数
ellipse: Ellipse

The ellipse to copy from.

返回this
#McopyTo
签名
copyTo(ellipse: Ellipse): Ellipse
描述

Copies this ellipse to another one.

@returns

Returns given parameter.

参数
ellipse: Ellipse

The ellipse to copy to.

返回Ellipse
#MstrokeContains
签名
strokeContains(x: number, y: number, width: number): boolean
描述

Checks whether the x and y coordinates given are contained within this ellipse including stroke

@returns

Whether the x/y coords are within this ellipse

参数
x: number

The X coordinate of the point to test

参数
y: number

The Y coordinate of the point to test

参数
width: number
返回boolean