Game Engine 2D Platformer
Public Member Functions | List of all members
GraphicsComponent Class Reference

GraphicsComponent class used to flip through frames for a GameEntity. More...

#include <GraphicsComponent.hpp>

Inheritance diagram for GraphicsComponent:
Inheritance graph
[legend]
Collaboration diagram for GraphicsComponent:
Collaboration graph
[legend]

Public Member Functions

 GraphicsComponent (SDL_Renderer *ren)
 Constructor for GraphicsComponent. More...
 
 ~GraphicsComponent ()
 Destructor for GraphicsComponent. More...
 
void StartUp ()
 Initializes attributes for GraphicsComponent. More...
 
void ShutDown ()
 Constructor for GraphicsComponent. More...
 
void Update (GameEntity &entity)
 Selects graphic to render depending on frame. More...
 
void Render (GameEntity &entity)
 Renders graphic. More...
 
void LoadImage (std::string filepath, SDL_Renderer *ren)
 Loads image to use for graphics. More...
 
- Public Member Functions inherited from Component
 Component ()=default
 Constuctor for Component class. More...
 
virtual void HandleEvent (GameEntity &entity)
 Handle the events of GameEntity object for children classes. More...
 

Detailed Description

GraphicsComponent class used to flip through frames for a GameEntity.

Constructor & Destructor Documentation

◆ GraphicsComponent()

GraphicsComponent::GraphicsComponent ( SDL_Renderer *  ren)

Constructor for GraphicsComponent.

Parameters
renRenderer of the main Game Loop

◆ ~GraphicsComponent()

GraphicsComponent::~GraphicsComponent ( )

Destructor for GraphicsComponent.

Member Function Documentation

◆ LoadImage()

void GraphicsComponent::LoadImage ( std::string  filepath,
SDL_Renderer *  ren 
)
virtual

Loads image to use for graphics.

Loads image to use for graphics and uses ResourceManager.

Parameters
filepaththe FilePath of the Image to be loaded
SDL_Rendererren
std::stringfilepath
SDL_Rendererren

Reimplemented from Component.

◆ Render()

void GraphicsComponent::Render ( GameEntity entity)
virtual

Renders graphic.

Parameters
GameEntityGameEntity Object
GameEntity&entity

Reimplemented from Component.

◆ ShutDown()

void GraphicsComponent::ShutDown ( )
virtual

Constructor for GraphicsComponent.

Reimplemented from Component.

◆ StartUp()

void GraphicsComponent::StartUp ( )
virtual

Initializes attributes for GraphicsComponent.

Reimplemented from Component.

◆ Update()

void GraphicsComponent::Update ( GameEntity entity)
virtual

Selects graphic to render depending on frame.

Parameters
GameEntity&entity

Implements Component.


The documentation for this class was generated from the following files: