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

Pages: [1]
1
SFML projects / SFGUI (old thread)
« on: July 02, 2011, 08:43:12 pm »
I have looked into this project, but it is still in development and not ready for use. Anyway it was a good look. Inspired me to write my own GUI.
What I suggest to tank is to hide signals private since currently they are public and anyone can emit a signal.

2
Window / How to position the text on (0, 0)?
« on: June 19, 2011, 04:41:46 pm »
I use sfml 2 and I try to center the text in my button. However it seems text has a vertical margin so even if position is (0, 0) it starts at (0,10) or something like that and it doesn't look right.

Here is the example. Any help?
Code: [Select]

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

int main()
{
   sf::RenderWindow  window(sf::VideoMode( 800, 600 ), "Test" );
 
   sf::Text     text( "Test!" );  

   window.Clear();

   window.Draw(text );
   
   window.Display();

   system("pause");

   return 0;
}

3
Window / [SFML2] Event Resized
« on: June 17, 2011, 11:00:24 am »
Thought I need to handle the event but it seems window is resized automatically. Stupid me.

4
Window / [SFML2] Event Resized
« on: June 17, 2011, 08:22:46 am »
Here is the code from tutorial modified to handle window event resized.
Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Window.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Events");

    // Start main loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.PollEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();

            // Resize window : set new size
            if (Event.Type == sf::Event::Resized)
                App.SetSize(Event.Size.Width, Event.Size.Height);
        }

        // Display window on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


Closing the window works fine however if I try to resize it keeps jumping between new and old size - looping in event loop. I don't know if it is my fault or a bug, any help appreciated!

Pages: [1]
anything