Class Ellipse

an ellipse Object

Constructors

constructor

  • new Ellipse(x, y, w, h): Ellipse
  • Parameters

    • x: number

      the center x coordinate of the ellipse

    • y: number

      the center y coordinate of the ellipse

    • w: number

      width (diameter) of the ellipse

    • h: number

      height (diameter) of the ellipse

    Returns Ellipse

Properties

_bounds

_bounds: Bounds

The bounding rectangle for this shape

pos

pos: Vector2d

the center coordinates of the ellipse

radius

radius: number

Maximum radius of the ellipse

radiusSq

radiusSq: Vector2d

Radius squared, for pythagorean theorom

radiusV

radiusV: Vector2d

Pre-scaled radius vector for ellipse

ratio

ratio: Vector2d

x/y scaling ratio for ellipse

type

type: string = "Ellipse"

the shape type (used internally)

Methods

clone

contains

  • contains(x, y?): boolean
  • check if this circle/ellipse contains the specified point

    Parameters

    • x: number

      x coordinate or a vector point to check

    • Optionaly: number

      y coordinate

    Returns boolean

    true if contains

    Example

    if (circle.contains(10, 10)) {
    // do something
    }
    // or
    if (circle.contains(myVector2d)) {
    // do something
    }
  • contains(vector): boolean
  • Parameters

    Returns boolean

getBounds

rotate

scale

scaleV

setShape

  • setShape(x, y, w, h): Ellipse
  • set new value to the Ellipse shape

    Parameters

    • x: number

      the center x coordinate of the ellipse

    • y: number

      the center y coordinate of the ellipse

    • w: number

      width (diameter) of the ellipse

    • h: number

      height (diameter) of the ellipse

    Returns Ellipse

    this instance for objecf chaining

transform

translate

Settings

Member Visibility

On This Page

AltStyle によって変換されたページ (->オリジナル) /