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

Pages: 1 [2]
General / Re: sf::Text not declaring properly?
« on: June 20, 2013, 02:31:54 pm »
Your lineone is in the scope of the if condition.

if ( !arial.loadFromFile ( "arial.ttf" ) )
{ }
sf::Text lineone;

that should fix your problem.

Graphics / Re: Unexpected Results when using .setOrigin()
« on: June 13, 2013, 01:49:16 am »
sf::Text::getGlobalBounds() has also values for top and left.

So instead of

label.setOrigin(label.getGlobalBounds().width/2, label.getGlobalBounds().height/2);


        label.getGlobalBounds().left + label.getGlobalBounds().width/2,
        label.getGlobalBounds().top + label.getGlobalBounds().height/2);

Graphics / Re: Unhandled Exception Error with Texture
« on: June 12, 2013, 07:10:50 pm »
Have you tried other images? Some images are corrupted but load fine in (some) image viewers.

General / Re: pollEvent problem
« on: May 29, 2013, 01:27:05 am »
You should definitely read the tutorials and the documentation.
Also if you don't provide us your code or a minimal example, it's hard to find out what you are trying to do exactly.  :)

I think you might have something like this:
while (window.isOpen())
        sf::Event event;
                // ...
        // call getKey and do something with it
        int key = getKey(&window);

        // ...

The problem with this is, that pollEvent() returns events as long as there are events and the code will only continue if there are no events in queue. So there are no events exept the last one when getKey() is called.

Also, like kralo9 said, you loop until an key is pressed. The window can't draw anything until that happens and seems to be frozen.

You probably want real time input here:
int getKey(sf::RenderWindow* window)
                return 0;
                return 1;

Hope that helps.  ;)

Pages: 1 [2]