#include "titleState.h" #include #include TitleState::TitleState(StateStack &stack, State::Context context) : State(stack, context) // TODO: Initialize UI properly to zeros //, ui(0,0,false,false,0,0) { context.textures->load(Textures::Id::Base_Font, "assets/img/Font/Font.png"); auto &fontTexture = context.textures->get(Textures::Id::Base_Font); Graphics::TextureFont::Descr fontDescr {"abcdefghijklmnopqrstuvwxyz1234567890!?.,$ ", 6,7}; auto font = new Graphics::TextureFont(fontTexture, fontDescr); context.textureFonts->manage(Fonts::Id::Base_Font, font); } void TitleState::update(sf::Time dt){ } void TitleState::render(){ static bool radioState = false; ui.initImUI(); Graphics::TextureFont &font = context_.textureFonts->get(Fonts::Id::Base_Font); radioState = ui.radioButton(context_.window, font, 21, "this is\nthe whole thing or maybe is just another bullshit code it doesn't work", radioState, sf::Vector2i(0,100), sf::Vector2i(200,50)); if (radioState){ ui.button(context_.window, 20, "Hidden button", sf::Vector2i(0,200), sf::Vector2i(200,100)); } ui.finishImUI(); } void TitleState::handleEvent(const sf::Event &event){ ui.handleEvent(event); }