-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsee.cpp
More file actions
49 lines (46 loc) · 1.25 KB
/
see.cpp
File metadata and controls
49 lines (46 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
#include <TGUI/TGUI.hpp>
#include<vector>
#include<iostream>
#include<thread>
using namespace std;
main()
{
sf::RenderWindow window(sf::VideoMode(1980,1080),"checking");
tgui::GuiSFML gui(window);
auto button=tgui::Button::create();
button->setSize(400,60);
button->setPosition(10,10);
sf::Texture tex;
tex.loadFromFile("search.png");
button->getRenderer()->setTexture(tex);
gui.add(button);
auto button2=tgui::Button::create();
button2->setSize(100,100);
button2->setPosition(500,500);
gui.add(button2);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
if(button->isMouseOnWidget(static_cast<sf::Vector2f>(sf::Mouse::getPosition(window))))
{
cout<<"\n on it";
}
if(button2->isMouseOnWidget(static_cast<sf::Vector2f>(sf::Mouse::getPosition(window))))
{
cout<<"\n 2 on it";
}
gui.handleEvent(event);
}
window.clear(sf::Color::Black);
gui.draw();
window.display();
}
}
*/