Panel użytkownika
Nazwa użytkownika:
Hasło:
Nie masz jeszcze konta?

[SFML]Wyświetlanie tekstu.

Ostatnio zmodyfikowano 2018-03-14 20:31
Autor Wiadomość
znyk
Temat założony przez niniejszego użytkownika
» 2018-03-14 17:50:33
C:\Windows\Fonts
P-170014
Pioxis
» 2018-03-14 17:51:36
C/C++
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window( sf::VideoMode( 800, 600 ), "Test" );
    sf::Text text;
    sf::Font font;
    font.loadFromFile( "C:\Windows\Fonts\arial.ttf" );
    text.setColor( sf::Color::White );
    text.setCharacterSize( 24 );
    text.setStyle( sf::Text::Bold );
    text.setFont( font );
    text.setString( "Hello world" );
   
    while( window.isOpen() )
    {
        sf::Event event;
        while( window.pollEvent( event ) )
        {
            if( event.type == sf::Event::Closed )
                 window.close();
           
        }
        window.clear();
        window.draw( text );
        window.display();
    }
    return EXIT_SUCCESS;
}

Wydaje mi się, że w taki sposób powinno być dobrze.
P-170015
Monika90
» 2018-03-14 20:31:03
font.loadFromFile( "C:\Windows\Fonts\arial.ttf" );

\a to jest bell
P-170016
1 « 2 »
Poprzednia strona Strona 2 z 2