Nimbin[12]?SDL & Graphics / sdl_runtime_compiler / src/systems/hint_system.cpp

sdl_runtime_compiler git · main

SDL3 game for running and compiling code at runtime

sdl3 c++ compiler dlopen cmake · first commit 2026-04-19 · last commit 2026-07-03 (3 months ago) · synced 3 days ago · upstream: git.ide3.de/hsnr/sdl-runtime-compiler

C++ 72.3% C 26.2%
git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gz
src/systems/hint_system.cpp 864 B · 44 lines raw
#include "entities/world.hpp"
#include "systems/hint_system.hpp"
#include "utils/config.hpp"

namespace
Nimbin
{

HintSystem::HintSystem()
{
    _label.set_Centre    (Vec3{ 0.0, World::get_FloorY<double>() + 2.5, 0.0 });
    _label.set_FaceCamera (true);
    _label.set_Style     (Config::Color::yellow, Text::Token::depth_wall, 0.003f);
    _label.set_Collidable(true);
}


void
HintSystem::set_Hint(const std::string& hint_text)
{
    if (hint_text == _current_hint) return;
    _current_hint = hint_text;
    _label.set_Text(hint_text);
}


void
HintSystem::clear()
{
    _current_hint.clear();
    _label.       clear();
}


void
HintSystem::update(double dt, const Camera& camera)
{ _label.update(dt, camera); }


void
HintSystem::draw(GlRenderer& gl, const Camera& camera, const Light& light) const
{ _label.draw(gl, camera, light); }

} // namespace Nimbin