Andreas Garmannslund / Mbed 2 deprecated SimplePlatformGame

Dependencies:   N5110 PinDetect PowerControl mbed

Embed: (wiki syntax)

« Back to documentation index

MainMenu Class Reference

State: Main Menu. More...

#include <MainMenu.h>

Inherits State.

Public Member Functions

 MainMenu (StateManager *fsm, N5110 *lcd, InputManager *input, Sound *sound)
 Creates a new MainMenu object.
virtual void update (float dt)
 Update logic.
virtual void render ()
 Draw MainMenu to screen.

Protected Member Functions

template<size_t rows, size_t cols>
void drawImage (const int(&img)[rows][cols], int x=0, int y=0, bool inverse=false, bool flipX=false, bool flipY=false)
 Draws an image to the lcd.

Detailed Description

State: Main Menu.

Definition at line 15 of file MainMenu.h.


Constructor & Destructor Documentation

MainMenu ( StateManager fsm,
N5110 *  lcd,
InputManager input,
Sound sound 
)

Creates a new MainMenu object.

Definition at line 19 of file MainMenu.h.


Member Function Documentation

void drawImage ( const int(&)  img[rows][cols],
int  x = 0,
int  y = 0,
bool  inverse = false,
bool  flipX = false,
bool  flipY = false 
) [protected, inherited]

Draws an image to the lcd.

Parameters:
imgArray with the same size as the display, where 1 is opaque, 0 is blank. Draws an image/sprite to the lcd Only the solid pixels are drawn. If two images overlap, the second image drawn will not clear pixels which are solid in the first image.
imgconst int array where a solid pixel equals 1, and a blank pixel equals zero
xHorizontal position of image (leftmost pixel)
yVertical position of image (uppermost pixel)
Inversesimages. Default value is false See seperate program for how this array can be generated from an image file using SFML!

Definition at line 75 of file State.h.

void render (  ) [virtual]

Draw MainMenu to screen.

Implements State.

Definition at line 47 of file MainMenu.cpp.

void update ( float  dt ) [virtual]

Update logic.

Implements State.

Definition at line 45 of file MainMenu.cpp.