Changeset f809ae6 in opengl-game for gui


Ignore:
Timestamp:
Jun 10, 2020, 9:44:02 PM (4 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master
Children:
6bfd91c
Parents:
699e83a
Message:

Show the score and frame rate on the game screen

Location:
gui
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • gui/game-screen.cpp

    r699e83a rf809ae6  
    99#include "button.hpp"
    1010#include "panel.hpp"
     11#include "ui-value.hpp"
    1112
    1213using namespace std;
     
    2021      Screen(renderer, gameInfo) {
    2122   Panel *statsPanel = new Panel(10, 50, 95, 46, 0x161616FF, this->renderer);
     23
     24   statsPanel->addUIElement(new UIValue(0, 0, "Score: ", this->gameInfo.score,
     25      this->gameInfo.proggyFont, 0xFFFFFFFF, this->renderer));
     26   statsPanel->addUIElement(new UIValue(14, 19, "FPS: ", this->gameInfo.fps,
     27      this->gameInfo.proggyFont, 0xFFFFFFFF, this->renderer));
    2228
    2329   // TODO: Add the button to the panel it's in, not directly to the window
Note: See TracChangeset for help on using the changeset viewer.