-
Notifications
You must be signed in to change notification settings - Fork 0
View.Circle.API
A class which is used for handling circles
Constructor for Circle class, uses the set function, to set the properties of the circle.
Name | Type | Argument | Default | Description |
---|---|---|---|---|
x |
number | The x-coordinate for the center of the circle |
||
y |
number | The y-coordinate for the center of the circle |
||
radius |
number | The radius for the circle |
||
fillStyle |
string |
<optional> |
"#000" | The circle's fill color if added to a view (css color string) |
strokeStyle |
string |
<optional> |
"#000" | The circle's color if added to a view (css color string) |
lineWidth |
number |
<optional> |
1 | The circle's width if added to a view (in px) |
- Source:
Name | Type | Description |
---|---|---|
x |
number | The circle's horizontal position |
y |
number | The circle's vertical position |
radius |
number | The circle's radius |
strokeStyle |
string | The circle's color if added to a view (css color string) |
lineWidth |
number | The circle's width if added to a view (in px) |
fillStyle |
string | The circle's fill color if added to a view (css color string) |
-
Used for animating numeric properties of the owner of the function. Available easing functions are: "linear" "quadIn" "quadOut" "quadInOut" "powerIn" "powerOut" "powerInOut" "sinusInOut"
Name Type Description properties
object An object containing key-value pairs in the following format:
{ "[property name]": "[end value]" }
options
object An object containing key-value pairs for the animation's option:
{ "duraton": "[animation duration (in ms)]", "callback": "[callback function]", "easing": "[easing function to use]" }
- Inherited From:
- Source:
-
- Inherited From:
- Source:
-
- Source:
-
Checks whether or not the Circle contains another geometric object.
Name Type Description object
Math.Vector | Math.Line | Math.Circle | Math.Rectangle | Math.Polygon A geometric object to check
- Inherited From:
- Source:
True if the Rectangle contains the checked object, false if not
- Type
- boolean
-
copy() → {Math.Circle}() → {Math.Circle}
-
Copies the Circle object.
- Inherited From:
- Source:
A copy of the Circle object (which can be modified without changing the original object)
- Type
- Math.Circle
-
Fetches all current animations of the object.
- Inherited From:
- Source:
An array of all the current animations of the object
- Type
- Object[]
-
Calculates the area of the Circle.
- Inherited From:
- Source:
The area of the Circle
- Type
- number
-
Calculates the direction to another child
Name Type Description child
View.Child The object to calculate the direction to
- Inherited From:
- Source:
The direction in radians
- Type
- number
-
Calculates the shortest distance from the Circle object to another geometric object
Name Type Description object
Math.Vector | Math.Line | Math.Circle | Math.Rectangle | Math.Polygon The object to calculate the distance to
- Inherited From:
- Source:
The distance
- Type
- number
-
Calculates the distance to another child (the distance between the object's positions)
Name Type Description child
View.Child The object to calculate the distance to
- Inherited From:
- Source:
The distance in pixels
- Type
- number
-
Creates and returns and array of all the child's parents (from closest to farthest)
- Inherited From:
- Source:
A list of all the child's parents
- Type
- View.Container[]
-
Calculates the perimeter of the circle
- Inherited From:
- Source:
The perimeter of the Circle
- Type
- number
-
<private> getRedrawRegion() → {Math.Rectangle}
-
Calculates the region which the object will fill out when redrawn.
- Source:
The bounding rectangle of the redraw
- Type
- Math.Rectangle
-
Finds the room to which the object is currently added
- Inherited From:
- Source:
The room to which the object is currently added, or false if the object is not added to a room
- Type
- View.Room | Boolean
-
getRoomPosition() → {Math.Vector|Boolean}() → {Math.Vector|Boolean}
-
Fetches the position of the child inside the room
- Inherited From:
- Source:
The objects position in its room, or false if the object is not placed in any room.
- Type
- Math.Vector | Boolean
-
Checks whether or not the Circle intersects with another geometric object.
Name Type Description object
Math.Line | Math.Circle | Math.Rectangle | Math.Polygon A geometric object to check. Supported objects are
- Inherited From:
- Source:
True if the Circle intersects with the checked object, false if not
- Type
- boolean
-
Checks if the object is currently being animated.
- Inherited From:
- Source:
Whether or not the object is being animated
- Type
- boolean
-
Checks if the child object is in a state where it will get drawn. For this function to return true, the child object has to be both visible and placed in a visible room.
- Inherited From:
- Source:
Whether or not the child object is in a state where it will get drawn
- Type
- Boolean
-
Checks if the child object is inside a room that is currently visible
- Inherited From:
- Source:
Whether or not the child object is currently in a visible room
- Type
- Boolean
-
Checks if the objects is visible. This function runs before each draw to ensure that it is necessary
- Inherited From:
- Source:
Whether or not the object is visible (based on its size and opacity vars)
- Type
- boolean
-
move(x, y) → {Math.Circle}(x, y) → {Math.Circle}
-
Moves the Circle by adding a value to its x-coordinate and another value to its y-coordinate.
Name Type Description x
number The value to add to the x-coordinate (can be negative)
y
number The value to add to the y-coordinate (can be negative)
- Inherited From:
- Source:
The resulting Circle object (itself)
- Type
- Math.Circle
-
Sets the position of the object relative to its parent
Name Type Description x
number The horisontal position
y
number The vertical position
- Inherited From:
- Source:
-
moveTo(x, y) → {Math.Circle}(x, y) → {Math.Circle}
-
Moves the Circle to a fixed position by setting its x- and y-coordinates.
Name Type Description x
number The x-coordinate of the position to move the Circle to
y
number The y-coordinate of the position to move the Circle to
- Inherited From:
- Source:
The resulting Circle object (itself)
- Type
- Math.Circle
-
parseOffsetGlobal(offset) → {Math.Vector}(offset) → {Math.Vector}
-
Parses an offset global into an actual Math.Vector offset (this function is only here for convenience and should be replaced by any class that inherits the child class)
Name Type Description offset
number Offset global (OFFSET_TOP_LEFT, etc.)
- Inherited From:
- Source:
A parsed version of the offset global
- Type
- Math.Vector
-
Checks if a specific property is current being animated
- Inherited From:
- Source:
Whether or not the property is being animated
- Type
- boolean
-
scale(factor) → {Math.Circle}(factor) → {Math.Circle}
-
Scales the Circle object by multiplying it radius with a factor. Please notice that, opposite to the Polygon and Line objects, the position of the Circle will not be changed by scaling it, since the center of the circle will not be scaled. Also: since ellipses are not supported yet, circles cannot be scaled with various factors horizontally and vertically, like the other geometric objects.
Name Type Description factor
number A factor with which to scale the Circle
- Inherited From:
- Source:
The resulting Circle object (itself)
- Type
- Math.Circle
-
set(x, y, radius) → {Math.Circle}(x, y, radius) → {Math.Circle}
-
Sets the properties of the circle.
Name Type Description x
number The x-coordinate for the center of the circle
y
number The y-coordinate for the center of the circle
radius
number The radius for the circle
- Inherited From:
- Source:
The resulting Circle object (itself)
- Type
- Math.Circle
-
Stops all current animations of the object.
- Inherited From:
- Source:
Generated with wicked.
- Engine.Camera
- Engine.CustomLoop
- Engine.Loader
- Engine.Room
- Engine
- Input.Keyboard
- Input.Pointer
- Math.Circle
- Math.Line
- Math.Polygon
- Math.Rectangle
- Math.Vector
- Sound.Effect
- Sound.Music
- View.Child
- View.Circle
- View.Collidable
- View.Container
- View.GameObject
- View.Line
- View.Polygon
- View.Rectangle
- View.Sprite
- View.TextBlock
- global