Contains the coordinates of the GameObject
.
More...
|
int | x |
| X position of the GameObject in pixels (0 is the left side of the screen).
|
|
int | y |
| Y position of the GameObject in pixels (0 is the top of the screen).
|
|
int | width |
| Width of the GameObject in pixels.
|
|
int | height |
| Height of the GameObject in pixels.
|
|
float | rotationAngle |
| Rotation angle in degrees.
|
|
SDL_Point | mRotationCenter |
| The point about which to rotate.
|
|
Contains the coordinates of the GameObject
.
Updating x and y instance variables will move the GameObject's rendered position.
- See also
- IComponent
-
GameObject
◆ this()
ComponentTransform::this |
( |
size_t | owner, |
|
|
int | x, |
|
|
int | y, |
|
|
int | width, |
|
|
int | height ) |
|
inline |
Initialize the GameObject's position.
- Parameters
-
owner | the id of the attached GameObject. |
x | the initial x coordinate. |
y | the initial y coordinate. |
width | the width of the GameObject. |
height | the height of the GameObject. |
◆ GetSmall()
bool ComponentTransform::GetSmall |
( |
| ) |
|
|
inline |
Whether the GameObject is rendered small or not.
- Returns
true
if rendering small, false
if rendering normal sized.
- See also
- isSmall
-
SetSmall
◆ IncrementRotation()
void ComponentTransform::IncrementRotation |
( |
float | delta | ) |
|
|
inline |
◆ IsVisible()
bool ComponentTransform::IsVisible |
( |
const SDL_Rect * | camera | ) |
|
|
inline |
Checks whether the GameObject is visible to the camera.
- Returns
true
if visible, otherwise false
.
◆ rect()
SDL_Rect ComponentTransform::rect |
( |
| ) |
|
|
inline |
◆ Render()
override void ComponentTransform::Render |
( |
SDL_Renderer * | renderer, |
|
|
SDL_Rect * | camera ) |
|
inline |
Render the given component.
Implements IComponent.
◆ SetRotationAngle()
void ComponentTransform::SetRotationAngle |
( |
float | angle | ) |
|
|
inline |
◆ SetSmall()
void ComponentTransform::SetSmall |
( |
bool | small, |
|
|
bool | isGravityFlipped ) |
|
inline |
Sets whether the GameObject should render small or not.
- Parameters
-
small | true to render small, false to render normal sized. |
isGravityFlipped | whether gravity is flipped for the GameObject. |
- See also
- isSmall
-
GetSmall
◆ Update()
override void ComponentTransform::Update |
( |
| ) |
|
|
inline |
Update internal state of the component.
Implements IComponent.
The documentation for this class was generated from the following file:
- Engine/source/component.d