Polygon Dash
Loading...
Searching...
No Matches
ComponentRender Class Reference

Render the GameObject on screen using a BMP image file. More...

Inheritance diagram for ComponentRender:
IComponent

Public Member Functions

 this (size_t owner, SDL_Renderer *renderer, ComponentTransform transform, ComponentAnimation animation)
 Setup the renderer.
 
override void Update ()
 Update the animation to go the next frame.
 
override void Render (SDL_Renderer *renderer, SDL_Rect *camera)
 Render the sprite on screen.
 
- Public Member Functions inherited from IComponent

Public Attributes

ComponentTransform mTransform
 Stores the location and orientation in which to render the GameObject.
 
ComponentAnimation mAnimation
 Stores the sprite details including which frame to render.
 

Detailed Description

Render the GameObject on screen using a BMP image file.

The render location is defined by ComponentTransform. The frame to render in an animation is defined by ComponentAnimation.

See also
ComponentTransform
ComponentAnimation

Constructor & Destructor Documentation

◆ this()

ComponentRender::this ( size_t owner,
SDL_Renderer * renderer,
ComponentTransform transform,
ComponentAnimation animation )
inline

Setup the renderer.

Parameters
ownerthe id of the attached GameObject.
rendererthe SDL renderer object.
transformthe ComponentTransform of the attached GameObject.
animationthe ComponentAnimation of the attached GameObject.

Member Function Documentation

◆ Render()

override void ComponentRender::Render ( SDL_Renderer * renderer,
SDL_Rect * camera )
inline

Render the sprite on screen.

Parameters
rendererthe SDL renderer to use.
camerathe SDL_Rect corresponding to the camera position and size.

Implements IComponent.

◆ Update()

override void ComponentRender::Update ( )
inline

Update the animation to go the next frame.

Implements IComponent.


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