src/functions/drawFunctions.h
/**
 * Affichage de texte de format 16 
 */
Affichage de texte de format 16
Affichage de texte de format 16
void drawtext16(int width,int height, String text ){
  #ifdef  DEVKIT1  
  const int startY = 18;
    int widthtext = text.length() * 12 - 1;
    display.setColor(BLACK);
    display.fillRect(width, height, widthtext, startY);
    display.setColor(WHITE);
    display.setTextAlignment(TEXT_ALIGN_LEFT);
    display.setFont(ArialMT_Plain_16);
    display.drawString(width,height, String(text) ); 
  #endif
  #ifdef  TTGO
    display.setCursor(width, height, 2); display.setTextSize(2);
    display.setTextColor(TFT_WHITE,TFT_BLACK);  display.setTextFont(2);
    display.print(String(text));
  #endif
}
void drawtext16 ( int width , int height , String text ) { #ifdef DEVKIT1 const int startY = 18 ; int widthtext = text . length ( ) * 12 - 1 ; display . setColor ( BLACK ) ; display . fillRect ( width , height , widthtext , startY ) ; display . setColor ( WHITE ) ; display . setTextAlignment ( TEXT_ALIGN_LEFT ) ; display . setFont ( ArialMT_Plain_16 ) ; display . drawString ( width , height , String ( text ) ) ; #endif #ifdef TTGO display . setCursor ( width , height , 2 ) ; display . setTextSize ( 2 ) ; display . setTextColor ( TFT_WHITE , TFT_BLACK ) ; display . setTextFont ( 2 ) ; display . print ( String ( text ) ) ; #endif }
Affichage de texte de format 16
Affichage de texte de format 16
// Calculate how wide (pixels) the text will be once rendered. // Each character = 6 pixels, with font size 2, that is 12 pixels. // -1 because of the spacing between letters (last one doesn't) /// clean rect /// write Data