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

Author Topic: [solved]Coordinate system  (Read 1244 times)

0 Members and 1 Guest are viewing this topic.

Hythloday

  • Newbie
  • *
  • Posts: 10
    • View Profile
[solved]Coordinate system
« 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]
« Last Edit: September 05, 2012, 11:07:19 am by Hythloday »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Coordinate system
« Reply #1 on: September 05, 2012, 10:58:11 am »
Don't forget to call _finalSurface.display().
Laurent Gomila - SFML developer

Hythloday

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Coordinate system
« Reply #2 on: September 05, 2012, 11:06:50 am »
Thank you very much ..... that's exactly what I missed..... ah I'm so stupid....

 

anything