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

Author Topic: Views not positioning right in the main window  (Read 1959 times)

0 Members and 1 Guest are viewing this topic.

joaosausen

  • Newbie
  • *
  • Posts: 10
    • View Profile
Views not positioning right in the main window
« on: March 26, 2014, 07:46:04 pm »
So, im trying to create a minimap on my game, the View for the game is working ok, but the minimap doesnt position well. Looks like the view for the minimap is not considering all the windows to determine his size.

If I use

minimap.setViewport(sf::FloatRect(0, 0, 0.25f, 0.25f));
this happens.



The View is not positioned at 0,0 and also has no 25% the size of the window. The other view is set has camera.setViewport(sf::FloatRect(0, 0, 1, 1)) and works well.

What can I do?

joaosausen

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Views not positioning right in the main window
« Reply #1 on: March 26, 2014, 08:40:02 pm »
well, now everything is working.

I changed
minimap.setSize(10000, 8000);
minimap.setCenter(0, 0);
to
minimap.reset(sf::FloatRect(0,0,10000,8000));

and its working now, I still dont know why.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Views not positioning right in the main window
« Reply #2 on: March 26, 2014, 08:53:53 pm »
Not related to your problem, but you may want to fix those compiler errors that are visible in your screenshot ;)

 

anything