A component that handles collision detection using a rectangle.
More...
|
| | this (GameObject *owner) |
| | Constructor for ComponentCollisionRect.
|
| |
|
override void | Update () |
| | Updates the collision rectangle, deriving it from the texture if necessary.
|
| |
| override void | Render (SDL_Renderer *renderer) |
| | Renders the collision rectangle for debugging purposes.
|
| |
| | typeof (this) SetCenter(SDL_Point center) |
| | Sets the center point of the collision rectangle.
|
| |
| | typeof (this) SetRadius(uint radius) |
| | Sets the radius of the collision rectangle.
|
| |
| SDL_Point | GetCenter () |
| | Gets the center point of the collision rectangle.
|
| |
| SDL_Rect * | GetRect () |
| | Gets the SDL_Rect representing the collision rectangle.
|
| |
| uint | GetRadius () |
| | Gets the radius of the collision rectangle.
|
| |
|
void | SetColliding () |
| | Sets the colliding state to true.
|
| |
| | typeof (this) DeriveFromTexture() |
| | Derives the collision rectangle from the texture component.
|
| |
| | typeof (this) OnTouch(void delegate(GameObject *self |
| | Registers a callback for when the object touches another object.
|
| |
| void | Touch (GameObject *object) |
| | Triggers the touch callbacks when the object touches another object.
|
| |
A component that handles collision detection using a rectangle.
◆ this()
| components::collision_rect::ComponentCollisionRect::this |
( |
GameObject * | owner | ) |
|
|
inline |
◆ GetCenter()
| SDL_Point components::collision_rect::ComponentCollisionRect::GetCenter |
( |
| ) |
|
|
inline |
Gets the center point of the collision rectangle.
- Returns
- The SDL_Point representing the center.
◆ GetRadius()
| uint components::collision_rect::ComponentCollisionRect::GetRadius |
( |
| ) |
|
|
inline |
Gets the radius of the collision rectangle.
- Returns
- The radius value.
◆ GetRect()
| SDL_Rect * components::collision_rect::ComponentCollisionRect::GetRect |
( |
| ) |
|
|
inline |
Gets the SDL_Rect representing the collision rectangle.
- Returns
- A pointer to the SDL_Rect.
◆ Render()
| override void components::collision_rect::ComponentCollisionRect::Render |
( |
SDL_Renderer * | renderer | ) |
|
|
inline |
Renders the collision rectangle for debugging purposes.
- Parameters
-
| renderer | Pointer to the SDL_Renderer. |
◆ Touch()
| void components::collision_rect::ComponentCollisionRect::Touch |
( |
GameObject * | object | ) |
|
|
inline |
Triggers the touch callbacks when the object touches another object.
- Parameters
-
◆ typeof() [1/4]
| components::collision_rect::ComponentCollisionRect::typeof |
( |
this | | ) |
|
|
inline |
Derives the collision rectangle from the texture component.
- Returns
- A reference to this ComponentCollisionRect.
◆ typeof() [2/4]
| components::collision_rect::ComponentCollisionRect::typeof |
( |
this | | ) |
|
Registers a callback for when the object touches another object.
- Parameters
-
| callback | The callback to register. |
- Returns
- A reference to this ComponentCollisionRect.
◆ typeof() [3/4]
| components::collision_rect::ComponentCollisionRect::typeof |
( |
this | | ) |
|
|
inline |
Sets the center point of the collision rectangle.
- Parameters
-
| center | The SDL_Point representing the center. |
- Returns
- A reference to this ComponentCollisionRect.
◆ typeof() [4/4]
| components::collision_rect::ComponentCollisionRect::typeof |
( |
this | | ) |
|
|
inline |
◆ callback
| GameObject* object components::collision_rect::ComponentCollisionRect::callback |
Initial value:{
mCallbacksOnTouch ~= callback
The documentation for this class was generated from the following file:
- src/components/collision_rect.d