Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes | List of all members
JAM_ArrowPad Class Reference

Creates an ArrowPad object. More...

#include <ArrowPad.h>

Collaboration diagram for JAM_ArrowPad:
Collaboration graph

Public Member Functions

 JAM_ArrowPad (float x, float y, float width, float height, SDL_Renderer *renderer)
 
 ~JAM_ArrowPad ()
 
void input (SDL_Event &incomingEvent)
 
void draw (SDL_Renderer *renderer)
 
bool getUp ()
 
bool getDown ()
 
bool getLeft ()
 
bool getRight ()
 

Private Attributes

JAM_Buttonup
 
JAM_Buttondown
 
JAM_Buttonleft
 
JAM_Buttonright
 
bool upCmd
 
bool downCmd
 
bool leftCmd
 
bool rightCmd
 

Detailed Description

Creates an ArrowPad object.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

JAM_ArrowPad::JAM_ArrowPad ( float  x,
float  y,
float  width,
float  height,
SDL_Renderer *  renderer 
)

Constructs the Button object.

Parameters
xThe x position of the Button.
yThe y position of the Button.
widthThe width of the Button.
heightThe height of the Button.
rendererA pointer to the SDL Renderer.
JAM_ArrowPad::~JAM_ArrowPad ( )

Destructs the ArrowPad object.

Member Function Documentation

void JAM_ArrowPad::draw ( SDL_Renderer *  renderer)

Draws the ArrowPad to the screen.

Parameters
rendererA pointer to the SDL renderer.

Here is the call graph for this function:

bool JAM_ArrowPad::getDown ( )

Getter # Gets the value of the down command.

Returns
The value of the down command.
bool JAM_ArrowPad::getLeft ( )

Getter # Gets the value of the left command.

Returns
The value of the left command.
bool JAM_ArrowPad::getRight ( )

Getter # Gets the value of the right command.

Returns
The value of the right command.
bool JAM_ArrowPad::getUp ( )

Getter # Gets the value of the up command.

Returns
The value of the up command.
void JAM_ArrowPad::input ( SDL_Event &  incomingEvent)

A function that updates the ArrowPad.

Parameters
incomingEventA reference to the incoming event.

Here is the call graph for this function:

Member Data Documentation

JAM_Button* JAM_ArrowPad::down
private

An down Button.

bool JAM_ArrowPad::downCmd
private
JAM_Button* JAM_ArrowPad::left
private

An left Button.

bool JAM_ArrowPad::leftCmd
private
JAM_Button* JAM_ArrowPad::right
private

An right Button.

bool JAM_ArrowPad::rightCmd
private
JAM_Button* JAM_ArrowPad::up
private

An up Button.

bool JAM_ArrowPad::upCmd
private

The commands for the user.


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