mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 21:09:19 +01:00
Add Text rendering and Hull / Fuel Meters
This commit is contained in:
26
Game/Gui/GuiText.cpp
Normal file
26
Game/Gui/GuiText.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "pch.h"
|
||||
#include "GuiText.h"
|
||||
|
||||
#include "colors.h"
|
||||
GuiText::GuiText(const Vector2f& position, const std::string& text, const std::string& fontPath, int size, const Color4f& color): m_Position(position), m_Text(new Text(text, fontPath, size, color)) {
|
||||
|
||||
}
|
||||
|
||||
GuiText::GuiText(): m_Position(100,100), m_Text(new Text("Undefined", "fonts/verdana.ttf", 10, Colors::WHITE)) {
|
||||
|
||||
}
|
||||
|
||||
void GuiText::Draw() const {
|
||||
m_Text->Draw(m_Position);
|
||||
}
|
||||
|
||||
void GuiText::Update(float elapsedSec) {
|
||||
}
|
||||
|
||||
void GuiText::ChangeText(const std::string& text) const {
|
||||
m_Text->ChangeText(text);
|
||||
|
||||
}
|
||||
GuiText::~GuiText() {
|
||||
delete m_Text;
|
||||
}
|
||||
Reference in New Issue
Block a user