SFTK/demo/demo1.cpp

18 lines
533 B
C++
Raw Permalink Normal View History

2024-08-03 04:11:49 +08:00
#include <sftk.hpp>
int main()
{
auto &window = sftk::Window::create(800, 600, L"demo1");
window.setBackgroudColor(sf::Color::White);
auto &label = sftk::Label::create(
L"SFTK demo.\nBy Random World Studio.",
sftk::Font("../demo/SarasaUiSC-Regular.ttf", 18));
label.setColor(sf::Color::Black);
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();
}