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.
Graphics Class Reference
#include <Graphics.h>
Public Member Functions | |
| Graphics () | |
| Constructor. | |
| ~Graphics () | |
| Destructor. | |
| void | Change_Contrast (N5110 &LCD, Gamepad &Device) |
| Changes the contrast of the LCD using the left potentiometer. | |
| void | Draw_Map (Point_2D translation, int angle, float squish, float horizon_factor, Line_2D *Track_Lines, Line_2D *Track_Dotted_Lines, Line_2D *Track_Walls, Sprite_2D *Track_Sprites, Triangle_2D *Track_Boost_Plates, Map_Data map_info, int car_type, Point_2D ghost_position, N5110 &LCD) |
| Draws all graphics required for the game (excluding lap counter, time, start count down and finishing trophy) | |
| void | Draw_Laps (int laps, N5110 &LCD) |
| Draws the current lap count. | |
| void | Draw_Time (bool finished, Time time, N5110 &LCD) |
| Draws the race time. | |
| void | Start_Sequence (int state, N5110 &LCD) |
| Draws the count down numbers before the race. | |
| void | Finish (N5110 &LCD) |
| Draws the finishing trophy. | |
| void | Draw_Logo (N5110 &LCD) |
| Draws the game logo on startup. | |
Detailed Description
Graphics Class.
Creates all game graphics.
- Date:
- Mar, 2020
Definition at line 96 of file Graphics.h.
Constructor & Destructor Documentation
| Graphics | ( | ) |
Constructor.
Definition at line 3 of file Graphics.cpp.
| ~Graphics | ( | ) |
Destructor.
Definition at line 7 of file Graphics.cpp.
Member Function Documentation
Changes the contrast of the LCD using the left potentiometer.
- Parameters:
-
LCD The object for the N5110 class (object) Device The object for the gamepad class (object)
Definition at line 182 of file Graphics.cpp.
| void Draw_Laps | ( | int | laps, |
| N5110 & | LCD | ||
| ) |
Draws the current lap count.
- Parameters:
-
laps The current lap count (int) LCD The object for the N5110 class (object)
Definition at line 218 of file Graphics.cpp.
| void Draw_Logo | ( | N5110 & | LCD ) |
Draws the game logo on startup.
- Parameters:
-
LCD The object for the N5110 class (object)
Definition at line 170 of file Graphics.cpp.
| void Draw_Map | ( | Point_2D | translation, |
| int | angle, | ||
| float | squish, | ||
| float | horizon_factor, | ||
| Line_2D * | Track_Lines, | ||
| Line_2D * | Track_Dotted_Lines, | ||
| Line_2D * | Track_Walls, | ||
| Sprite_2D * | Track_Sprites, | ||
| Triangle_2D * | Track_Boost_Plates, | ||
| Map_Data | map_info, | ||
| int | car_type, | ||
| Point_2D | ghost_position, | ||
| N5110 & | LCD | ||
| ) |
Draws all graphics required for the game (excluding lap counter, time, start count down and finishing trophy)
- Parameters:
-
translation The translation of the map. See Mechanics class. (Point_2D) angle The rotation of the map. See Mechanics class. (int) squish The y-axis squish of the map to get the 3D effect. (float) horizon_factor This is the squishing on x-axis points depending on their y-position to make it look more 3D *Track_Lines Pointer for the array for track lines. (Line_2D) *Track_Dotted_Lines Pointer for the array for dotted lines. (Line_2D) *Track_Walls Pointer for the array for walls. (Line_2D) *Track_Sprites Pointer for the array for sprite positions. (Sprite_2D) *Track_Boost_Plates Pointer for the array for boost plate positions. (Triangle_2D) map_info Struct containing the number of elements in each array above (Map_Data) car_type The car selected. (int) ghost_position The current position of the ghost. (Point_2D) LCD The object for the N5110 class (object)
Definition at line 24 of file Graphics.cpp.
Draws the race time.
- Parameters:
-
finised The current lap count (bool) time The time elapsed from the race so far (Time) LCD The object for the N5110 class (object)
Definition at line 237 of file Graphics.cpp.
| void Finish | ( | N5110 & | LCD ) |
Draws the finishing trophy.
- Parameters:
-
LCD The object for the N5110 class (object)
Definition at line 208 of file Graphics.cpp.
| void Start_Sequence | ( | int | state, |
| N5110 & | LCD | ||
| ) |
Draws the count down numbers before the race.
- Parameters:
-
state The current count down number (int) LCD The object for the N5110 class (object)
Definition at line 192 of file Graphics.cpp.
Generated on Wed Jul 20 2022 17:42:24 by
1.7.2