2024-08-03 04:11:49 +08:00
|
|
|
#include <sftk.hpp>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
auto &window = sftk::Window::create(800, 600, L"demo1");
|
2024-08-20 10:51:14 +08:00
|
|
|
window.setBackgroudColor(sf::Color::White);
|
2024-09-11 21:03:19 +08:00
|
|
|
auto &label = sftk::Label::create(
|
|
|
|
L"SFTK demo.\nBy Random World Studio.",
|
|
|
|
sftk::Font("../demo/SarasaUiSC-Regular.ttf", 18));
|
2024-08-20 10:51:14 +08:00
|
|
|
label.setColor(sf::Color::Black);
|
2024-09-11 21:03:19 +08:00
|
|
|
window.registerEvent(
|
|
|
|
sftk::EventType::Resized,
|
|
|
|
std::function(
|
|
|
|
[&label](sf::Vector2f size)
|
|
|
|
{ label.setPosition(size - label.getSize()); }));
|
2024-08-03 04:11:49 +08:00
|
|
|
window.exec();
|
|
|
|
}
|