Constructor
new Circle(r, copt)
- Source:
Create new Circle element.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
r |
number | Radius of circle. | ||
c |
string |
<optional> |
"#000000"
|
Color of circle. |
Extends
Members
anchor :Pixel.Point
- Source:
- Overrides:
The anchor position of the sprite.
Type:
(readonly) color :string
- Source:
The color of the circle.
Type:
- string
deg :number
- Source:
- Overrides:
- Default Value:
- 0
The degress of rotation on the sprite.
Type:
- number
flipX :boolean
- Source:
- Overrides:
- Default Value:
- false
Determines if the sprite is flipped over the x axis.
Type:
- boolean
flipY :boolean
- Source:
- Overrides:
- Default Value:
- false
Determines if the sprite is flipped over the y axis.
Type:
- boolean
height :number
- Source:
- Overrides:
Height of the Sprite's hitbox.
Type:
- number
id :string
- Source:
- Overrides:
- Default Value:
- 0
The id of the sprite, used to find sprites when deleting them.
Type:
- string
opacity :number
- Source:
- Overrides:
The opacity of the sprite.
Type:
- number
point :Pixel.Point
- Source:
- Overrides:
The position of the sprite.
Type:
(readonly) radius :number
- Source:
The radius of the circle.
Type:
- number
render
- Source:
Renders circle.
scale :number
- Source:
- Overrides:
- Default Value:
- 1
The scale of the sprite (0 --> 1).
Type:
- number
width :number
- Source:
- Overrides:
Width of the Sprite's hitbox.
Type:
- number
x :number
- Source:
- Overrides:
X position.
Type:
- number
y :number
- Source:
- Overrides:
Y position.
Type:
- number
Methods
copy(sprite)
- Source:
- Overrides:
Copy the value of another sprite onto this one.
Parameters:
Name | Type | Description |
---|---|---|
sprite |
Pixel.Sprite | Sprite who's values this will copy. |
reset(ctx)
- Source:
- Overrides:
Resets settings set on sprite.
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2d | Context to reset settings on. |
setAnchor(x, y)
- Source:
- Overrides:
Set the position the sprite is anchored to (0-->1).
Parameters:
Name | Type | Description |
---|---|---|
x |
number | X position, scale of 0 to 1. |
y |
number | Y position, scale of 0 to 1. |
setSize(w, h)
- Source:
- Overrides:
Sets the hitbox size of the sprite.
Parameters:
Name | Type | Description |
---|---|---|
w |
number | Width. |
h |
number | Height. |
settings(ctx)
- Source:
- Overrides:
Applies settings set on sprite.
Parameters:
Name | Type | Description |
---|---|---|
ctx |
CanvasRenderingContext2d | Context to apply settings to. |
spin(num)
- Source:
- Overrides:
Spins x * 360 degrees.
Parameters:
Name | Type | Description |
---|---|---|
num |
number | Amount of times sprite rotates 360 degrees. |