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 - LonelyCoder

Pages: [1]
1
Graphics / Re: Error to load font
« on: October 21, 2013, 03:24:23 pm »
Ty everyone, problem solved..
I had a mistake in my libraries, like Laurent said. Thanks one more time. :)

2
Graphics / Re: Error to load font
« on: October 21, 2013, 12:26:32 pm »
The problem keep.. I update the code, the problem it's on the line with ("°"), i'm also try to put the arial.ttf in paste debug and release, but don't work.. At last i didn't know that wasn't free. :S

3
Graphics / Error to load font
« on: October 21, 2013, 10:38:40 am »
Hey, i got a problem to load a font in SFML.. The code is correct. The font is in a right place.. I don't understand what is the problem.. Can you help me?

That is my code:
#include "SFML/Graphics.hpp"
#include "SFML\Window.hpp"
#include "SFML\System.hpp"
#include <iostream>
using namespace std;

class FPS
{
       
public:
        int fps, counter;
        sf::Clock clock;
        FPS(int x = 0, int y = 0) {fps = x;counter = y;}

        void Update()
        { counter++; if(clock.getElapsedTime().asMilliseconds() >= 125)
        {fps = counter*8; counter = 0; clock.restart(); } }

};


int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "SFML works!");
        FPS FPS(0,0);
       
        sf::Text text2;
        sf::Font font1;
       
        °°°°°°if(!font1.loadFromFile("arial.ttf"))
        {
                return 1;
        }
        text2.setFont(font1);
        text2.setString("Hello world");
        text2.setColor(sf::Color::White);
        text2.setPosition(0, 0);
        text2.setScale(2, 1);
       
        while (window.isOpen())
    {
               
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

                FPS.Update();
                std::cout << FPS.fps << std::endl;

                window.draw(text2);
                window.clear();
        window.display();
               
    }

    return 0;
}

That is my problem:


And that is my config and databases:




Regards. Lonely Coder

4
C / SFML 1.6 and C++ Create a game Menu
« on: March 27, 2013, 06:09:47 pm »
Hi ppl,

I'm starting a new project and i'm wanting to start to make a game menu, possibly for using in other game project, But i don't know how to create a menu and manage a different screens..

Can you help me?

Cumps. Lonely

Pages: [1]
anything