# Class: Ellipse

## Phaser. Ellipse

Phaser - Ellipse

#### new Ellipse(x, y, width, height) → {Phaser.Ellipse}

  Creates a Ellipse object. A curve on a plane surrounding two focal points.

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `x` | number | <optional> | 0 | The X coordinate of the upper-left corner of the framing rectangle of this ellipse.
  `y` | number | <optional> | 0 | The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.
  `width` | number | <optional> | 0 | The overall width of this ellipse.
  `height` | number | <optional> | 0 | The overall height of this ellipse.

  Source:
    - geom/Ellipse.js, line 19

  ##### Returns:

  This Ellipse object

  Type
    Phaser.Ellipse

### Members

#### bottom

  The sum of the y and height properties. Changing the bottom property of an Ellipse doesn't adjust the y property, but does change the height.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `bottom` | number | Gets or sets the bottom of the ellipse.

  Source:
    - geom/Ellipse.js, line 209

#### empty

  Determines whether or not this Ellipse object is empty. Will return a value of true if the Ellipse objects dimensions are less than or equal to 0; otherwise false. If set to true it will reset all of the Ellipse objects properties to 0. An Ellipse object is empty if its width or height is less than or equal to 0.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `empty` | boolean | Gets or sets the empty state of the ellipse.

  Source:
    - geom/Ellipse.js, line 234

#### height

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `height` | number | The overall height of this ellipse.

  Source:
    - geom/Ellipse.js, line 46

#### left

  The left coordinate of the Ellipse. The same as the X coordinate.

  Source:
    - geom/Ellipse.js, line 148

#### right

  The x coordinate of the rightmost point of the Ellipse. Changing the right property of an Ellipse object has no effect on the x property, but does adjust the width.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `right` | number | Gets or sets the value of the rightmost point of the ellipse.

  Source:
    - geom/Ellipse.js, line 167

#### top

  The top of the Ellipse. The same as its y property.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `top` | number | Gets or sets the top of the ellipse.

  Source:
    - geom/Ellipse.js, line 192

#### width

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `width` | number | The overall width of this ellipse.

  Source:
    - geom/Ellipse.js, line 41

#### x

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `x` | number | The X coordinate of the upper-left corner of the framing rectangle of this ellipse.

  Source:
    - geom/Ellipse.js, line 31

#### y

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `y` | number | The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.

  Source:
    - geom/Ellipse.js, line 36

### Methods

#### <static> contains(a, x, y) → {boolean}

  Return true if the given x/y coordinates are within the Ellipse object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `a` | Phaser.Ellipse | The Ellipse to be checked.
  `x` | number | The X value of the coordinate to test.
  `y` | number | The Y value of the coordinate to test.

  Source:
    - geom/Ellipse.js, line 257

  ##### Returns:

  True if the coordinates are within this ellipse, otherwise false.

  Type
    boolean

#### <static> getBounds() → {Phaser.Rectangle}

  Returns the framing rectangle of the ellipse as a Phaser.Rectangle object.

  Source:
    - geom/Ellipse.js, line 283

  ##### Returns:

  The framing rectangle

  Type
    Phaser.Rectangle

#### clone(out) → {Phaser.Ellipse}

  Returns a new Ellipse object with the same values for the x, y, width, and height properties as this Ellipse object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `out` | Phaser.Ellipse | Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.

  Source:
    - geom/Ellipse.js, line 101

  ##### Returns:

  The cloned Ellipse object.

  Type
    Phaser.Ellipse

#### contains(x, y) → {boolean}

  Return true if the given x/y coordinates are within this Ellipse object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `x` | number | The X value of the coordinate to test.
  `y` | number | The Y value of the coordinate to test.

  Source:
    - geom/Ellipse.js, line 122

  ##### Returns:

  True if the coordinates are within this ellipse, otherwise false.

  Type
    boolean

#### copyFrom(source) → {Phaser.Ellipse}

  Copies the x, y, width and height properties from any given object to this Ellipse.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `source` | any | The object to copy from.

  Source:
    - geom/Ellipse.js, line 72

  ##### Returns:

  This Ellipse object.

  Type
    Phaser.Ellipse

#### copyTo(dest) → {Object}

  Copies the x, y and diameter properties from this Circle to any given object.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `dest` | any | The object to copy to.

  Source:
    - geom/Ellipse.js, line 84

  ##### Returns:

  This dest object.

  Type
    Object

#### setTo(x, y, width, height) → {Phaser.Ellipse}

  Sets the members of the Ellipse to the specified values.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `x` | number | The X coordinate of the upper-left corner of the framing rectangle of this ellipse.
  `y` | number | The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.
  `width` | number | The overall width of this ellipse.
  `height` | number | The overall height of this ellipse.

  Source:
    - geom/Ellipse.js, line 52

  ##### Returns:

  This Ellipse object.

  Type
    Phaser.Ellipse

#### toString() → {string}

  Returns a string representation of this object.

  Source:
    - geom/Ellipse.js, line 135

  ##### Returns:

  A string representation of the instance.

  Type
    string