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: Rasturizer/Rasturizer.cpp
- Revision:
- 16:64cd7bc094f9
- Parent:
- 15:8fbbdefbe720
- Child:
- 17:3c9672c6e532
diff -r 8fbbdefbe720 -r 64cd7bc094f9 Rasturizer/Rasturizer.cpp
--- a/Rasturizer/Rasturizer.cpp Sun Mar 31 14:56:55 2019 +0000
+++ b/Rasturizer/Rasturizer.cpp Sun Mar 31 18:05:01 2019 +0000
@@ -1,6 +1,6 @@
-#include "mbed.h"
#include "Rasturizer.h"
+
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
Rasturizer::Rasturizer(){
@@ -97,8 +97,8 @@
}
}
-void Rasturizer::print(const char *text){
- lcd.printString(text, 0, 0);
+void Rasturizer::print(const char *text, int x, int y){
+ lcd.printString(text, x, y);
}
void Rasturizer::clear(){
@@ -109,10 +109,34 @@
lcd.refresh();
}
-void Rasturizer::invertMode(){
- lcd.inverseMode();
-}
-
-void Rasturizer::normalMode(){
- lcd.normalMode();
+void Rasturizer::drawDeathScreen(bool selection){
+ int x;
+ int y;
+ int z;
+
+ if(selection == true){
+ x = -30;
+ y = -3;
+ z = 50;
+ }
+ else{
+ x = -30;
+ y = 15;
+ z = 50;
+ }
+
+ lcd.drawRect(24, 14, 45, 11, FILL_WHITE);
+ lcd.drawRect(24, 14, 45, 11, FILL_TRANSPARENT);
+ lcd.printString("Restart",26,2);
+ lcd.drawRect(24, 30, 45, 11, FILL_WHITE);
+ lcd.drawRect(24, 30, 45, 11, FILL_TRANSPARENT);
+ lcd.printString("Menu",35,4);
+ selectionCube.translate(x, y, z);
+ for(int i = 0; i < 6; i++){
+ drawFace(selectionCube.getFace(i), 0);
+ }
+ selectionCube.rotateX(0.1);
+ selectionCube.rotateY(0.05);
+ selectionCube.rotateZ(-0.08);
+ selectionCube.translate(-x, -y, -z);
}
\ No newline at end of file