multiplayer pong game for LPC 1768
Dependencies: mbed MbedJSONValue mbed-rtos Adafruit_ST7735 Adafruit_GFX EthernetInterface DebouncedInterrupt
Diff: graphics.cpp
- Revision:
- 17:32ae1f106002
- Parent:
- 16:7fd48cda0773
- Child:
- 18:32fce82690a1
--- a/graphics.cpp Fri Nov 13 23:02:56 2020 +0000 +++ b/graphics.cpp Sat Nov 14 02:37:13 2020 +0000 @@ -2,16 +2,28 @@ #include "graphics.h" Graphics::Graphics() { + printf("\n\rInitializing Graphics: initializing TFT\n\r"); this->tft = new Adafruit_ST7735(P_MOSI, P_MISO, P_SOCK, P_CS, P_RS, P_DC); - tft->initR(); - tft->fillScreen(ST7735_RED); + printf("Initializing Graphics: optimizing display for resolution\n\r"); + tft->initR(INITR_144GREENTAB); + tft->setTextColor(ST7735_WHITE); } - void Graphics::renderLaunchScreen() { + tft->fillScreen(ST7735_BLACK); + tft->setTextCursor(20, 20); + tft->printf("%s", "Multiplayer Pong"); + tft->setTextCursor(20, 80); + tft->printf("%s", "Press any button to continue."); +} + +void Graphics::renderBall(GameState *gs) { -} +} + +void Graphics::renderPlayers(GameState *gs) { +} void Graphics::renderGameState(GameState *gs) { - + tft->fillScreen(ST7735_RED); } \ No newline at end of file