#pragma once #include "engine/prefabs/includes.h" class TitleScreen : public Scene { public: Font font; std::string title = "Guitar Hero But Better"; void init() override { auto font_manager = game->get_manager(); font = font_manager->get_font("Roboto"); } void update(float delta_time) override { bool start = IsKeyPressed(KEY_ENTER); for (int gp = 0; gp < 4; gp++) { if (IsGamepadAvailable(gp) && IsGamepadButtonPressed(gp, GAMEPAD_BUTTON_MIDDLE_RIGHT)) start = true; } if (start) game->go_to_scene("song_select"); } void draw() override { auto width = GetScreenWidth(); auto height = GetScreenHeight(); auto title_text_size = MeasureTextEx(font, title.c_str(), 64, 0); std::string subtitle = "Press Start";// or Enter to Play"; auto subtitle_text_size = MeasureTextEx(font, subtitle.c_str(), 32, 0); ClearBackground(SKYBLUE); DrawTextEx(font, title.c_str(), {(width - title_text_size.x) / 2, (height - title_text_size.y - 100) / 2}, 64, 1, WHITE); DrawTextEx(font, subtitle.c_str(), {(width - subtitle_text_size.x) / 2, (height - subtitle_text_size.y + 100) / 2}, 32, 1, WHITE); } };