Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////// h file
- class Phonk
- {
- bool isNothing = true;
- bool isHovered = false;
- sf::Text text;
- sf::Font font;
- public:
- Phonk();
- void setText(sf::Vector2f pos, std::string value,int size);
- bool clicked(sf::Vector2f cursor, bool isClick);
- sf::Text getText() { return text; };
- };
- class UI
- {
- private:
- std::vector<Phonk> settings;
- public:
- UI(double)
- sf::Text getTextFromSettings();
- };
- ///////////////////////// cpp file
- UI::UI(double health)
- {
- for (int i = 0; i < 1; i++)
- {
- settings.push_back(Phonk());
- }
- settings[0].setText(sf::Vector2f(-1000, -500), "set screen size for anal sex", 150);
- }
- void Phonk::setText(sf::Vector2f pos, std::string value,int size)
- {
- text.setString(value);
- text.setCharacterSize(size);
- text.setPosition(pos);
- text.setOrigin((text.getGlobalBounds().width + text.getGlobalBounds().left - text.getGlobalBounds().left) / 2, (text.getGlobalBounds().height + text.getGlobalBounds().top - text.getGlobalBounds().top) / 2);
- }
- Text UI::getTextFromSettings()
- {
- return settings[0].getText();
- }
- /////// main file
- window.draw(user_interface.getTextFromSettings());
- /////////////error: Exception thrown at 0x00007FFD5EA639E3 (sfml-graphics-2.dll) in NoPasaran.exe: 0xC0000005: Access violation reading location 0x000000070000000E.
Advertisement
Add Comment
Please, Sign In to add comment