Circle

Circle

{Object} Circle Circle object

Constructor

new Circle()

Description:
  • Create a Circle object
Source:
Properties:
Name Type Attributes Default Description
point Point X & Y axis coordinates
radius number | Point <optional>
25 Radius of circle
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
mass number Mass of object
velocity Point X & Y velocity coordinates

Methods

anchor() → {Anchor}

Description:
  • Get anchor
Source:
Returns:
Anchor properties
Type
Anchor

angle() → {Angle}

Description:
  • Get angle properties
Source:
Returns:
Angle properties
Type
Angle

area() → {number}

Description:
  • Get area of this object
Source:
Returns:
Area of this object
Type
number

bounds() → {Object}

Description:
  • Get bounds of object
Source:
Returns:
Bounds of object
Type
Object

canvas(value)

Description:
  • Set canvas value
Source:
See:
  • individual.canvas
Parameters:
Name Type Description
value string Canvas id

canvas() → {string}

Description:
  • Get canvas value
Source:
See:
  • individual.canvas
Returns:
Canvas id
Type
string

center() → {Point}

Description:
  • Get center of this object
Source:
Returns:
Point coordinates
Type
Point

circumference() → {number}

Description:
  • Get circumference of circle
Source:
Returns:
Circumference of circle
Type
number

diameter() → {number}

Description:
  • Get diameter of circle
Source:
Returns:
Diameter of circle
Type
number

draw(canvas)

Description:
  • Draw this object
Source:
Parameters:
Name Type Description
canvas string Canvas Id

fill(value)

Description:
  • Set fill properties
Source:
Parameters:
Name Type Description
value Fill Fill properties

fill() → {Fill}

Description:
  • Get fill properties
Source:
Returns:
Fill properties
Type
Fill

isThere(circle) → {boolean}

Description:
  • Check whether the passed object is already present
Source:
Parameters:
Name Type Description
circle Circle Object to validate
Returns:
True || False
Type
boolean

mass(value)

Description:
  • Set mass
Source:
Parameters:
Name Type Description
value number Mass of object

mass() → {number}

Description:
  • Get mass
Source:
Returns:
Mass of object
Type
number

move(degree, distance)

Description:
  • Move this object
Source:
See:
Parameters:
Name Type Description
degree number Direction to move; in degrees
distance number Distance to move

options() → {Options}

Description:
  • Get options properties
Source:
Returns:
Options properties
Type
Options

point(value)

Description:
  • Set point
Source:
See:
Parameters:
Name Type Description
value Point X & Y coordinates

point() → {Point}

Description:
  • Get point
Source:
See:
Returns:
X & Y coordinates
Type
Point

position() → {Position}

Description:
  • Get position properties
Source:
Returns:
Position properties
Type
Position

radius(value)

Description:
  • Set radius value
Source:
Parameters:
Name Type Description
value number | Point Radius of circle

radius() → {number|Point}

Description:
  • Get radius value
Source:
Returns:
Radius of circle
Type
number | Point

rotate(degree, anchoropt, clearopt)

Description:
  • Rotate this object
Source:
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:
Returns:
Shadow properties
Type
Shadow

showCoordinates(offsetopt, fontSizeopt)

Description:
  • Shows coordinates of this object
Source:
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:
Parameters:
Name Type Description
value Stroke Stroke properties

stroke() → {Stroke}

Description:
  • Get stroke properties
Source:
Returns:
Stroke properties
Type
Stroke

velocity(value)

Description:
  • Set velocity
Source:
Parameters:
Name Type Description
value number Velocity of object

velocity() → {number}

Description:
  • Get velocity
Source:
Returns:
Velocity of object
Type
number

x(value)

Description:
  • Set x-axis value
Source:
See:
Parameters:
Name Type Description
value number X coordinate value

x() → {number}

Description:
  • Get x-axis value
Source:
See:
Returns:
X coordinate value
Type
number

y(value)

Description:
  • Set y-axis value
Source:
See:
Parameters:
Name Type Description
value number Y coordinate value

y() → {number}

Description:
  • Get y-axis value
Source:
See:
Returns:
Y coordinate value
Type
number