-
canCastShadow() → {boolean}
-
Checks if the object can cast shadows.
- Inherited From:
- Source:
Returns:
True if it cast shadows, false otherwise.
-
Type
-
boolean
-
canReceiveLight() → {boolean}
-
Checks if an object can receive light.
- Inherited From:
- Source:
Returns:
True if it receives light.
-
Type
-
boolean
-
<protected> computeBoundingBoxPosition()
-
Computes the bounding box position, from the object's position
and bounding box offset.
- Inherited From:
- Source:
-
<protected> computeTexturePosition()
-
Computes the texture position of the object, from the object's
position and texture offset.
- Inherited From:
- Source:
-
-
Creates a clone object to be passed through the network.
- Source:
Returns:
Network clone.
-
Type
-
Grape2D.SnapshotNetworkObject2D
-
-
Gets the bounding box of the object.
- Inherited From:
- Source:
Returns:
The shape of the object.
-
Type
-
Grape2D.Shape
-
-
Gets the bounding box offset
- Inherited From:
- Source:
Returns:
The bounding box offset.
-
Type
-
Grape2D.Vector
-
getBoundingBoxPosition() → {Grape2D.Vector}
-
Gets the bounding box position.
- Inherited From:
- Source:
Returns:
The center position of the bounding box.
-
Type
-
Grape2D.Vector
-
getId() → {number|string}
-
Gets the object's id.
- Source:
Returns:
Object's id.
-
Type
-
number
|
string
-
-
Gets the object position. Be careful, because it returns the
vector used by the object, and not a copy. Use it wisely.
- Inherited From:
- Source:
Returns:
The position of the object.
-
Type
-
Grape2D.Vector
-
-
Gets the texture of the object.
- Inherited From:
- Source:
Returns:
The texture of the object.
-
Type
-
Grape2D.Texture
-
-
Gets the texture offset
- Inherited From:
- Source:
Returns:
The texture offset.
-
Type
-
Grape2D.Vector
-
-
Gets the texture position.
- Inherited From:
- Source:
Returns:
The position of the texture
-
Type
-
Grape2D.Vector
-
isVisible() → {boolean}
-
Checks if the object should be rendered.
- Inherited From:
- Source:
Returns:
True if it can be rendered.
-
Type
-
boolean
-
process()
-
- Source:
-
render()
-
- Source:
-
renderInterpolate(renderer, camera, lerpPosition)
-
Renders an object in an interpolating position.
Parameters:
- Source:
-
setBoundingBox(boundingBox)
-
Sets the bounding box of the object.
Also, the position of the new bounding box, will be transformed
in the default offset of the bounding box.
Parameters:
Name |
Type |
Description |
boundingBox |
Grape2D.Shape
|
The bounding box. |
- Inherited From:
- Source:
-
setBoundingBoxOffset(offset)
-
Sets the bounding box offset.
Parameters:
Name |
Type |
Description |
offset |
Grape2D.Vector
|
The offset of the bounding
box, from the object's position. |
- Inherited From:
- Source:
-
setCastShadow(castShadow)
-
Sets if an object can cast shadows.
Parameters:
Name |
Type |
Description |
castShadow |
boolean
|
True to cast shadows, false
otherwise. |
- Inherited From:
- Source:
-
setId(id)
-
Sets the object's id.
Parameters:
Name |
Type |
Description |
id |
number
|
string
|
Object's id. |
- Source:
-
setPosition(position)
-
Sets the object position.
Parameters:
Name |
Type |
Description |
position |
Grape2D.Vector
|
The position of the object. |
- Inherited From:
- Source:
-
setReceiveLight(receiveLight)
-
Sets if the object can receive light.
Parameters:
Name |
Type |
Description |
receiveLight |
boolean
|
True if it receives light. |
- Inherited From:
- Source:
-
setTexture(texture)
-
Sets the texture of the object.
Parameters:
- Inherited From:
- Source:
-
setTextureOffset(offset)
-
Sets the texture offset.
Parameters:
Name |
Type |
Description |
offset |
Grape2D.Vector
|
The offset of the texture, from
the object's position. |
- Inherited From:
- Source:
-
setVisible(visible)
-
Sets if an object should be rendered.
Parameters:
Name |
Type |
Description |
visible |
boolean
|
True, so that it renders, false
otherwise. |
- Inherited From:
- Source:
-
update(dt, scene)
-
Updates the object. This method should be refined in further
subclasses if needed be.
Parameters:
Name |
Type |
Description |
dt |
number
|
Time interval. |
scene |
Grape2D.Scene
|
Scene where this object is. |
- Inherited From:
- Source: