20 lines
678 B
C++
20 lines
678 B
C++
#include <iostream>
|
|
|
|
#include <sftk.hpp>
|
|
|
|
int main()
|
|
{
|
|
auto &window = sftk::Window::create(800, 600, L"demo1");
|
|
auto container = sftk::Container::create(vec(100.f, 100.f), vec(400.f, 400.f), window.getRoot());
|
|
container->setBackgroudColor(sf::Color::White);
|
|
container->registerEvent(
|
|
sftk::EventType::MouseDragged,
|
|
std::function(
|
|
[](sf::Vector2f start, sf::Vector2f now, sf::Mouse::Button button)
|
|
{ std::cout << "(" << start.x << "," << start.y << ")"
|
|
<< "->(" << now.x << "," << now.y << ")"
|
|
<< "|" << button
|
|
<< std::endl; }));
|
|
window.exec();
|
|
}
|