SFML community forums

Help => Graphics => Topic started by: Hythloday on September 05, 2012, 10:42:24 am

Title: [solved]Coordinate system
Post by: Hythloday on September 05, 2012, 10:42:24 am
I am tring to build a GUI system of my own.
But weird thing happened when I try to render a RenderTexture on RenderWindow.

What I did was create a sprite from that RenderTexture:

        Sprite surface;       
        surface.setTexture(_finalSurface.getTexture());
        surface.setPosition(_screenBounds.left, _screenBounds.top);
        render_target.draw(surface);

and in main function:

        Window* wnd = Window::Factory.newInstance2(gui);       
        wnd->position.set(Point(50,50));
        wnd->size.set(Size(300,300));

but what I got is like this:

Instead of left-top corner, the form appeared in the left-bottom corner....

Isn't Y in SFML's coordinate system should be UP to DOWN???

[attachment deleted by admin]
Title: Re: Coordinate system
Post by: Laurent on September 05, 2012, 10:58:11 am
Don't forget to call _finalSurface.display().
Title: Re: Coordinate system
Post by: Hythloday on September 05, 2012, 11:06:50 am
Thank you very much ..... that's exactly what I missed..... ah I'm so stupid....