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: N5110 PinDetect PowerControl mbed
State Class Reference
Abstract class for states in the program's main finite state machine. All state implementations is derived from this abstract class. More...
#include <State.h>
Inherited by Game, GameOver, MainMenu, SubmitHighscore, and TitleScreen.
Public Member Functions | |
virtual void | update (float dt)=0 |
Handle user input and update logic. | |
virtual void | render ()=0 |
Draw 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
Abstract class for states in the program's main finite state machine. All state implementations is derived from this abstract class.
Definition at line 20 of file State.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] |
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!
virtual void render | ( | ) | [pure virtual] |
Draw to screen.
Implemented in Game, GameOver, MainMenu, SubmitHighscore, and TitleScreen.
virtual void update | ( | float | dt ) | [pure virtual] |
Handle user input and update logic.
Implemented in Game, GameOver, MainMenu, SubmitHighscore, and TitleScreen.
Generated on Tue Jul 12 2022 21:59:48 by
