Constructor
new Ellipse()
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
point |
Point | X & Y axis coordinates | ||
radius |
Point |
<optional> |
<Point<20, 30>
|
Radius of ellipse |
angle |
Angle | Angle properties | ||
stroke |
Stroke | Stroke properties | ||
fill |
Fill | Fill properties | ||
shadow |
Shadow | Shadow properties | ||
canvas |
HTMLCanvasElement | 2D canvas context | ||
anchor |
Anchor | Anchor properties | ||
options |
Options | Options for this object | ||
position |
Position | Position properties |
Extends
Methods
anchor() → {Anchor}
- Description:
- Get anchor
- Source:
- Inherited From:
Returns:
Anchor properties
- Type
- Anchor
angle() → {Angle}
- Description:
- Get angle properties
- Source:
- Inherited From:
Returns:
Angle properties
- Type
- Angle
area() → {number}
- Description:
- Get area of this object
- Source:
- Inherited From:
Returns:
Area of this object
- Type
- number
bounds() → {Object}
- Description:
- Get bounds of object
- Source:
- Inherited From:
Returns:
Bounds of object
- Type
- Object
canvas(value)
- Description:
- Set canvas value
- Source:
- Overrides:
- See:
-
- individual.canvas
Parameters:
Name | Type | Description |
---|---|---|
value |
string | Canvas id |
center() → {Point}
- Description:
- Get center of this object
- Source:
- Inherited From:
Returns:
Point coordinates
- Type
- Point
circumference() → {number}
- Description:
- Get circumference of circle
- Source:
- Inherited From:
Returns:
Circumference of circle
- Type
- number
diameter() → {number}
- Description:
- Get diameter of circle
- Source:
- Inherited From:
Returns:
Diameter of circle
- Type
- number
draw(canvas)
- Description:
- Draw this object
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
canvas |
string | Canvas Id |
fill(value)
- Description:
- Set fill properties
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
Fill | Fill properties |
isThere(circle) → {boolean}
- Description:
- Check whether the passed object is already present
- Source:
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
circle |
Circle | Object to validate |
Returns:
True || False
- Type
- boolean
mass(value)
- Description:
- Set mass
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Mass of object |
move(degree, distance)
- Description:
- Move this object
- Source:
- Inherited From:
- See:
Parameters:
Name | Type | Description |
---|---|---|
degree |
number | Direction to move; in degrees |
distance |
number | Distance to move |
options() → {Options}
- Description:
- Get options properties
- Source:
- Inherited From:
Returns:
Options properties
- Type
- Options
point(value)
- Description:
- Set point
- Source:
- Overrides:
- See:
Parameters:
Name | Type | Description |
---|---|---|
value |
Point | X & Y coordinates |
position() → {Position}
- Description:
- Get position properties
- Source:
- Inherited From:
Returns:
Position properties
- Type
- Position
radius(value)
- Description:
- Set radius value
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
Point | Radius of circle |
radius() → {Point}
- Description:
- Get radius value
- Source:
- Overrides:
Returns:
Radius of circle
- Type
- Point
rotate(degree, anchoropt, clearopt)
- Description:
- Rotate this object
- Source:
- Inherited From:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
degree |
number | Distance to rotate; in degrees | ||
anchor |
string |
<optional> |
'center'
|
Anchoring point during rotation |
clear |
number |
<optional> |
true
|
Clear canvas during each rotation |
shadow() → {Shadow}
- Description:
- Get shadow properties
- Source:
- Inherited From:
Returns:
Shadow properties
- Type
- Shadow
showCoordinates(offsetopt, fontSizeopt)
- Description:
- Shows coordinates of this object
- Source:
- Inherited From:
- See:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
offset |
number |
<optional> |
10
|
Offset of coordinates y origin |
fontSize |
number |
<optional> |
16
|
Coordinates font size |
stroke(value)
- Description:
- Set stroke properties
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
Stroke | Stroke properties |
velocity(value)
- Description:
- Set velocity
- Source:
- Overrides:
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Velocity of object |
x(value)
- Description:
- Set x-axis value
- Source:
- Overrides:
- See:
Parameters:
Name | Type | Description |
---|---|---|
value |
number | X coordinate value |
y(value)
- Description:
- Set y-axis value
- Source:
- Overrides:
- See:
Parameters:
Name | Type | Description |
---|---|---|
value |
number | Y coordinate value |