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
Diff: Menu/Menu.h
- Revision:
- 45:fe5fc85a5c73
- Parent:
- 44:a6a361bea806
- Child:
- 47:5ae8668af63f
diff -r a6a361bea806 -r fe5fc85a5c73 Menu/Menu.h --- a/Menu/Menu.h Wed May 08 16:46:21 2019 +0000 +++ b/Menu/Menu.h Thu May 09 03:56:41 2019 +0000 @@ -6,22 +6,51 @@ #include "Gamepad.h" #include "Ship.h" +/** Menu Class +@brief Library for displaying menu screen +@author Ozoemena Adrian Ikenna +@date 8th May 2019 +*/ class Menu { public: + /** constructor */ Menu(); + /** deconstructor */ ~Menu(); - // Displays title screen + /** A mutator method that initializes the cursor used to select options in the menu + *@param ycursor: the yposition of the rectangle used as a cursor + */ void init(int ycursor); + /** Displays the title screen and changes the displayed ship based on ship selected + *@param &lcd: pointer to the N5110 library used for the lcd display + *@param shipUsed: a variable of enum SHIP which contains the ship currently being used + */ void title(N5110 &lcd, SHIP shipUsed); - void update(Direction d); + /** A mutator method that updates the x and y cursor values based on joystick movemnt + *@param d: the current direction of the joystick + *@param joystick: a 2D vector of the x and y joystick value + */ + void update(Direction d,Vector2D joystick); + /** Accessor method to get tthe current ycursor position used to select options + *from the menu + *@returns the ycursor value + */ int get_ycursor(); + /** Accessor method to get the current xcursor position used to select a ship + *in the ship section of the menu + *@returns the xcursor value + */ int get_xcursor(); + /** Displays the ship in the menu home screen + *@param &lcd: pointer to the N5110 library used for the lcd display + */ void disp_ships(N5110 &lcd); //void Menu::scroll(N5110 &lcd, Direction d); private: + //_______________Private-Variables__________________________________________ int _xcursor; int _ycursor;