1 #include "MessageState.hpp"
3 #include "Environment.hpp"
8 MessageState::MessageState(Environment &env)
10 message.Position(glm::vec3(0.0f), Gravity::CENTER);
12 press_key.Position(glm::vec3(0.0f, env.assets.large_ui_font.LineSkip(), 0.0f), Gravity::CENTER);
13 press_key.Set(env.assets.small_ui_font, "press any key to continue");
17 void MessageState::SetMessage(const char *msg) {
18 message.Set(env.assets.large_ui_font, msg);
22 void MessageState::ClearMessage() {
26 void MessageState::Handle(const SDL_Event &e) {
27 if (e.type == SDL_KEYDOWN) {
32 void MessageState::Update(int dt) {
36 void MessageState::Render(Viewport &viewport) {
37 if (message.Visible()) {
38 message.Render(viewport);
40 if (press_key.Visible()) {
41 press_key.Render(viewport);