1
General discussions / Re: Italian members?
« on: August 07, 2022, 10:25:39 pm »
Here I am.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Quoteone thing needed is the gui builder, or just an example on how to add all the gaugesWhat do you mean with adding all the gauges?
Files created by the gui builder can be imported in code by executinggui.loadWidgetsFromFile("form.txt");
The gui builder still needs a lot of work, it has been neglected a bit since it was released. This might be something that I could improve in the next version.
#include <SFML/Graphics.hpp>
#include <vector>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
std::vector<sf::RenderWindow*> windows;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::A)
{
sf::ContextSettings settings;
settings.antialiasingLevel = 8;
sf::RenderWindow* wnd = new sf::RenderWindow();
wnd->create({ 800, 800 }, "2", sf::Style::Default, settings);
windows.push_back(wnd);
}
if (event.key.code == sf::Keyboard::D)
{
for (auto wnd : windows)
wnd->close();
// delete wnd;
windows.clear();
}
}
}
window.clear();
window.draw(shape);
window.display();
for (auto wnd : windows)
{
wnd->clear();
wnd->display();
}
}
return 0;
}