hello everybody
i want to align a text box with the bottom edge of the screen. but the way i'm doing it is not working correctly. this is a minimal code example:
#include <SFML/Graphics.hpp>
int main(){
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
sf::Font font;
font.loadFromFile("automati.ttf");
sf::Text text("One\nTwo\nThree\nFour", font, 30);
text.setPosition(window.getSize().x*0.02, window.getSize().y - text.getGlobalBounds().height);
text.setColor(sf::Color::Black);
while (window.isOpen()){
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed){
window.close();
}
}
window.clear(sf::Color::White);
window.draw(text);
window.display();
}
return 0;
}
and this is the result:
i searched it, but haven't found anything about...
i'm using SFML 2.4 from the oficial Debian Testing repositories.
thanks in advance