1.44 tft lcd display

Dependencies:   TFT_fonts mbed-os

Fork of newTFTLCD by madhu sudhana

Revision:
28:6ac2fa56f82c
Parent:
22:4c169297f374
Child:
29:35482446e4ee
diff -r 26491d710e72 -r 6ac2fa56f82c lcd_base.cpp
--- a/lcd_base.cpp	Mon Jul 22 01:48:06 2013 +0000
+++ b/lcd_base.cpp	Thu May 24 07:55:36 2018 +0000
@@ -84,9 +84,10 @@
     _background = color;
 }
 
-void LCD::SetFont( const font_t *font )
+void LCD::SetFont( const unsigned char font_t )
 {
-    _font = font;
+    //_font = font;
+    _font = _font;
 }
 
 inline
@@ -150,7 +151,7 @@
 inline
 void LCD::ClearScreen( void )
 {
-    FillScreen( -1 );
+    FillScreen( 0 );//changed from -1  to 0 by madhu
 }
 
 void LCD::DrawPixel( unsigned short x, unsigned short y, int color )
@@ -396,6 +397,23 @@
         else
             RotateChar( *str++, x, y, i, fgColor, bgColor, deg );
 }
+void LCD::Printinv( const char *str, unsigned short x, unsigned short y, int fgColor, int bgColor, unsigned short deg )
+{
+    int stl, i;
+
+    stl = strlen( str );
+
+    if ( x == RIGHT )
+        x = GetWidth() - ( stl * _font->Width );
+    if ( x == CENTER )
+        x = ( GetWidth() - ( stl * _font->Width ) ) / 2;
+
+    for ( i = 0; i < stl; i++ )
+        if ( deg == 0 )
+            PrintChar( *str++, x -( i * ( _font->Width ) ), y, fgColor, bgColor );
+        else
+            RotateChar( *str++, x, y, i, fgColor, bgColor, deg );
+}
 
 void LCD::DrawBitmap( unsigned short x, unsigned short y, const bitmap_t* img, unsigned char scale )
 {