Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed N5110 ShiftReg PinDetect
Game Class Reference
#include <Game.h>
Inherits State.
Public Member Functions | |
Game (StateManager *fsm, N5110 *lcd, InputManager *input, Sound *sound, ShiftReg *shiftreg) | |
Creates the Game state. | |
~Game () | |
Deconstructor: Frees all memory that was temporarely allocated by the Game state. | |
virtual void | update (float dt) |
Handle input and update logic. | |
virtual void | render () |
Draw state to lcd. | |
Protected Member Functions | |
template<class T , size_t rows, size_t cols> | |
void | drawImage (const T(&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
Definition at line 15 of file Game.h.
Constructor & Destructor Documentation
Game | ( | StateManager * | fsm, |
N5110 * | lcd, | ||
InputManager * | input, | ||
Sound * | sound, | ||
ShiftReg * | shiftreg | ||
) |
~Game | ( | ) |
Member Function Documentation
void drawImage | ( | const T(&) | 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:
-
img Array 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. img const int array where a solid pixel equals 1, and a blank pixel equals zero x Horizontal position of image (leftmost pixel) y Vertical position of image (uppermost pixel) Inverses images. Default value is false See seperate program for how this array can be generated from an image file using SFML!
void render | ( | ) | [virtual] |
Generated on Tue Jul 12 2022 21:30:56 by
