Class: Ellipse

Tiny. Ellipse

The Ellipse object can be used to specify a hit area for displayObjects

new Tiny.Ellipse(x, y, width, height)

Name Type Default Description
x number 0 optional

The X coordinate of the center of this circle

y number 0 optional

The Y coordinate of the center of this circle

width number 0 optional

The half width of this ellipse

height number 0 optional

The half height of this ellipse

Members

heightnumber

Default Value:
  • 0

readonlytypenumber

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

Default Value:
  • Tiny.SHAPES.ELIP
See:

widthnumber

Default Value:
  • 0

xnumber

Default Value:
  • 0

ynumber

Default Value:
  • 0

Methods

Creates a clone of this Ellipse instance

Returns:
Type Description
Tiny.Ellipse a copy of the ellipse

contains(x, y){boolean}

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

Name Type Description
x number

The X coordinate of the point to test

y number

The Y coordinate of the point to test

Returns:
Type Description
boolean Whether the x/y coords are within this ellipse

Returns the framing rectangle of the ellipse as a Rectangle object

Returns:
Type Description
Tiny.Rectangle the framing rectangle
Documentation generated by JSDoc 3.4.3 on Mon Dec 24 2018 15:56:51 GMT+0800 (CST)