mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-17 01:11:47 +01:00
26 lines
626 B
C++
26 lines
626 B
C++
#include "pch.h"
|
|
#include "Screen.h"
|
|
|
|
Screen::Screen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): m_Position(pos), m_Size(size) {
|
|
m_Background = manager->GetTexture(filePath);
|
|
}
|
|
Screen::~Screen() {
|
|
for (Button* b : m_Buttons) {
|
|
delete b;
|
|
}
|
|
}
|
|
void Screen::Update(float elapsedSecs) {
|
|
for (Button* b : m_Buttons) {
|
|
b->Update(elapsedSecs);
|
|
}
|
|
}
|
|
void Screen::Draw() const {
|
|
Rectf dest = Rectf(m_Position, m_Size);
|
|
Rectf src = Rectf(0, 0, m_Background->GetWidth(), m_Background->GetHeight());
|
|
m_Background->Draw(dest, src, false);
|
|
|
|
for (Button* b : m_Buttons) {
|
|
b->Draw();
|
|
}
|
|
}
|