Skip to content

Commit

Permalink
Update HUD.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nb183 authored Feb 27, 2019
1 parent 803a57c commit 982caaf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Sky-Bomber/HUD.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
#include "../HUD.h"
#include <SFML/Audio.hpp>

LifeFuel::LifeFuel(float width, float height)
#include <iostream>
#include <sstream>
using namespace std;
LifeFuel::LifeFuel(float width, float height, int fuel)
{


// << "The value is :" << fuel << "\n";
if (!font.loadFromFile("resources/numberfont.ttf"))
{
std::cout << "Loading Failed" << std::endl;
}

stringstream ss;

ss.str("");
ss << fuel;

Lifefuel[0].setFont(font);
Lifefuel[0].setColor(sf::Color::Black);
Lifefuel[0].setString("3");
Lifefuel[0].setString(ss.str());
Lifefuel[0].setScale(1.5, 1.5);
Lifefuel[0].setPosition(sf::Vector2f(width-1346.0f, height - 738.0f));

Expand All @@ -38,3 +45,4 @@ void LifeFuel::draw(sf::RenderWindow &window)
}



0 comments on commit 982caaf

Please sign in to comment.