Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - Arzimon

Pages: [1]
1
Graphics / Re: Text not Drawing
« on: June 04, 2012, 06:54:48 pm »
All of the examples work except the ones that need OpenAL. my b bout the code.

2
Graphics / Re: Text not Drawing
« on: June 03, 2012, 10:52:06 pm »
tried it and its still not showing up, lol. Hopefully its just an error on my part.
Here's the updated code

#include<SFML/System.hpp>
#include<SFML/Graphics.hpp>
#include<iostream>

using namespace sf;

int main(int argc, char** argv)
{      
        RenderWindow app;
       
        Image screen;
        sf::Event e;

        app.create(VideoMode(800,600,32), "SFML Fonts");


        Text text("Hello World",Font::getDefaultFont(),100);
        text.setColor(Color(0,0,255));
        text.setStyle(Text::Regular);
        text.setRotation(90.0f);
        text.setScale(2.0f,2.0f);
        text.move(10.0f, 10.0f);
        app.draw(text);
       
        app.display();


       

        while(app.isOpen())
        {      
                while(app.pollEvent(e))
                {
               
                        if(e.type == Event::Closed)
                        {
                                app.close();
                        }
                        if((e.type == Event::KeyPressed) && (e.key.code == Keyboard::Escape))
                        {
                                        app.close();
                        }

                        if(e.key.code == Keyboard::S)
                        {
                                screen = app.capture();
                                screen.saveToFile("screenshot.jpg");
                        }

                }

               
               
                app.clear(Color(Color::White));
                app.draw(text);
                app.display();

        }

        return 0;
}

3
Graphics / Re: Text not Drawing
« on: June 03, 2012, 05:28:28 pm »
tried creating the window first, no luck.  :(

4
Graphics / Text not Drawing
« on: June 03, 2012, 04:24:25 pm »
Hey all! New to SFML and trying to get the following code to work. Got all the dependencies to work, but now the text won't display.  :P I followed the tutorial on the site but to no avail. here's my code:

#define _WIN32_WINNT 0x500
#include<Windows.h>
#include<SFML/System.hpp>
#include<SFML/Graphics.hpp>
#include<iostream>

using namespace sf;

int main(int argc, char** argv)
{
        HWND hwnd = GetConsoleWindow();
        ShowWindow(hwnd, SW_HIDE);
       
        RenderWindow app;
        const Input& in = app.GetInput();
        Image screen;
        sf::Event e;

        String text("Hello World",Font::GetDefaultFont(),100);
        text.SetColor(Color(0,0,255));
        text.SetStyle(String::Regular);
        text.SetRotation(90.0f);
        text.SetScale(2.0f,2.0f);
        text.Move(10.0f, 10.0f);
        app.Draw(text);
       
        app.Create(VideoMode(800,600), "SFML Fonts");
        app.Display();

       

        while(app.IsOpened())
        {      
                while(app.GetEvent(e))
                {
               
                        if(e.Type == Event::Closed)
                        {
                                app.Close();
                                ShowWindow(hwnd, SW_RESTORE);
                        }
                        if((e.Type == Event::KeyPressed) && (e.Key.Code == Key::Escape))
                        {
                                        app.Close();
                        }

                        if(e.Key.Code == Key::S)
                        {
                                screen = app.Capture();
                                screen.SaveToFile("screenshot.jpg");
                        }

                }

               
               
                app.Clear(Color(Color::White));
                app.Draw(text);
                app.Display();

        }

        return 0;

}

Pages: [1]