#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
int main()
{
sf::Vector2i m;
sf::RenderWindow window(sf::VideoMode(1920, 1080), "ПИРИВАДЧИК!!!!");
sf::Texture OneWindow;
OneWindow.loadFromFile("OneWindow.png");
sf::Sprite OneWindowS;
OneWindowS.setTexture(OneWindow);
OneWindowS.setPosition(0, 0);
sf::Texture knopka1;
knopka1.loadFromFile("Knopka1.png");
sf::Sprite knopka1S;
knopka1S.setTexture(knopka1);
knopka1S.setPosition(75, 541);
sf::Texture knopka2;
knopka1.loadFromFile("Knopka2.png");
sf::Sprite knopka2S;
knopka2S.setTexture(knopka2);
knopka2S.setPosition(75, 141);
bool checkPos1 = false;
bool checkPos2 = false;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
if (event.key.code == sf::Keyboard::Escape)
window.close();
break;
case sf::Event::MouseMoved:
checkPos1 = knopka1S.getGlobalBounds().contains(event.mouseMove.x, event.mouseMove.y);
checkPos2 = knopka2S.getGlobalBounds().contains(event.mouseMove.x, event.mouseMove.y);
break;
}
}
window.clear();
window.draw(OneWindowS);
if (checkPos1)
window.draw(knopka1S);
if (checkPos2)
window.draw(knopka2S);
window.display();
}
return 0;
}