JKSV/Source/AppStates/TaskState.cpp
2024-12-05 20:04:47 -05:00

24 lines
624 B
C++

#include "AppStates/TaskState.hpp"
#include "Colors.hpp"
#include "SDL.hpp"
void TaskState::Update(void)
{
if (!m_Task.IsRunning())
{
AppState::Deactivate();
}
}
void TaskState::Render(void)
{
// Grab task string.
std::string Status = m_Task.GetStatus();
// Center so it looks perty
int StatusX = 640 - (SDL::Text::GetWidth(18, Status.c_str()) / 2);
// Dim the background states.
SDL::RenderRectFill(NULL, 0, 0, 1280, 720, Colors::BackgroundDim);
// Render the status.
SDL::Text::Render(NULL, StatusX, 351, 18, SDL::Text::NO_TEXT_WRAP, Colors::White, Status.c_str());
}