CS4850 Final Project
Loading...
Searching...
No Matches
Public Member Functions | List of all members
TransformComponent Struct Reference

A component that represents a 2D transformation. More...

#include <TransformComponent.hpp>

Inheritance diagram for TransformComponent:
Component

Public Member Functions

 TransformComponent (SDL_FRect rectangle)
 
void Input (float deltaTime) override
 Handle input.
 
void Update (float deltaTime) override
 Update the game state.
 
void Render (SDL_Renderer *renderer) override
 Render the game.
 
ComponentType GetType () override
 Get the type of the component.
 
void SetW (float w)
 Set the width of the transformation.
 
void SetH (float h)
 Set the height of the transformation.
 
void SetWH (float w, float h)
 Set the width and height of the transformation.
 
float GetW () const
 Get the width of the transformation.
 
float GetH () const
 Get the height of the transformation.
 
void SetX (float x)
 Set the x position of the transformation.
 
void SetY (float y)
 Set the y position of the transformation.
 
void SetXY (float x, float y)
 Set the x and y position of the transformation.
 
float GetX () const
 Get the x position of the transformation.
 
float GetY () const
 Get the y position of the transformation.
 
SDL_FRect GetRectangle () const
 Get the transformation as an SDL_FRect.
 
- Public Member Functions inherited from Component
void SetGameEntity (std::shared_ptr< GameEntity > gameEntity)
 Set the game entity that the component is attached to.
 
std::shared_ptr< GameEntityGetGameEntity ()
 Get the game entity that the component is attached to.
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::shared_ptr< GameEntitymGameEntity
 

Detailed Description

A component that represents a 2D transformation.

Member Function Documentation

◆ GetH()

float TransformComponent::GetH ( ) const

Get the height of the transformation.

Returns
float

◆ GetRectangle()

SDL_FRect TransformComponent::GetRectangle ( ) const

Get the transformation as an SDL_FRect.

Returns
SDL_FRect

◆ GetType()

ComponentType TransformComponent::GetType ( )
overridevirtual

Get the type of the component.

Returns
ComponentType

Implements Component.

◆ GetW()

float TransformComponent::GetW ( ) const

Get the width of the transformation.

Returns
float

◆ GetX()

float TransformComponent::GetX ( ) const

Get the x position of the transformation.

Returns
float

◆ GetY()

float TransformComponent::GetY ( ) const

Get the y position of the transformation.

Returns
float

◆ Input()

void TransformComponent::Input ( float deltaTime)
overridevirtual

Handle input.

Parameters
deltaTimeTime since last frame

Reimplemented from Component.

◆ Render()

void TransformComponent::Render ( SDL_Renderer * renderer)
overridevirtual

Render the game.

Parameters
rendererSDL renderer

Reimplemented from Component.

◆ SetH()

void TransformComponent::SetH ( float h)

Set the height of the transformation.

Parameters
hHeight

◆ SetW()

void TransformComponent::SetW ( float w)

Set the width of the transformation.

Parameters
wWidth

◆ SetWH()

void TransformComponent::SetWH ( float w,
float h )

Set the width and height of the transformation.

Parameters
wWidth
hHeight

◆ SetX()

void TransformComponent::SetX ( float x)

Set the x position of the transformation.

Parameters
xX position

◆ SetXY()

void TransformComponent::SetXY ( float x,
float y )

Set the x and y position of the transformation.

Parameters
xX position
yY position

◆ SetY()

void TransformComponent::SetY ( float y)

Set the y position of the transformation.

Parameters
yY position

◆ Update()

void TransformComponent::Update ( float deltaTime)
overridevirtual

Update the game state.

Parameters
deltaTimeTime since last frame

Reimplemented from Component.


The documentation for this struct was generated from the following file: