ELEC2645 (2018/19) / Mbed 2 deprecated el17aio

Dependencies:   mbed

Revision:
10:c33d7593a275
Parent:
9:241a1a7d8527
Child:
11:73cd744ffa80
--- a/Menu/Menu.cpp	Tue Apr 09 05:14:07 2019 +0000
+++ b/Menu/Menu.cpp	Tue Apr 09 06:43:01 2019 +0000
@@ -15,9 +15,8 @@
 {
     _ycursor = ycursor;
 
-
 }
-void Menu::title(N5110 &lcd, Direction d)
+void Menu::title(N5110 &lcd)
 {
 
     // title sprite
@@ -96,7 +95,13 @@
     // as the printString function divides screen into 6 with each line needing eight pixels
     // The problem with the code currently is that the title is defined outside the normal game loop as such,
     // the values for _d which are updated in read_input in the RosenEngine function are never called
+    
+    lcd.drawRect(1,_ycursor,26,8,FILL_TRANSPARENT);
+}
 
+void Menu::update(Direction d)
+{
+    
     if (d == N) {
         _ycursor = _ycursor - 8;
     }
@@ -109,14 +114,12 @@
     if(_ycursor > 24) {
         _ycursor = 24;
     }
-
-    lcd.drawRect(1,_ycursor,26,8,FILL_TRANSPARENT);
-
 }
 int Menu::get_cursor()
 {
     return _ycursor;
 }
+
 /*void Menu::scroll(N5110 &lcd, Direction d)
 {