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

Author Topic: [SOLVED]Seperate Views or Area of View  (Read 1457 times)

0 Members and 1 Guest are viewing this topic.

Nyran

  • Newbie
  • *
  • Posts: 2
    • View Profile
[SOLVED]Seperate Views or Area of View
« on: June 05, 2011, 07:43:34 pm »
Hi there,
After getting to know views a little bit I find them a nice way to scale images on screen. Unfortunately I tried to limit the Area, in which the view is active.
I guess there's no way to do that, because the view seems to affect the whole screen (why am i asking then?:>), but if there's any option to do something similiar it would be nice to hear about it before I'm doing an other approach.

On the image below is what I try to achieve:

Let's say we have a RenderTarget which measures 800x600, then the left side should be a view, (half-size and center doesn't matter), but it shoult just occupy 600x600 Units, so that I can render a "own" GUI area on the remaining space of 200x600.
The reason why i can't just push the GUI-Box to View.Rectangle.right - 200 is, that I've got a Zoom-Function in my App and the GUI-Box (realized with sf::Shape or something similiar) shouldn't change it's optical size.





In my opinion the least work would mean scaling the GUI-Box inversely proportional to the Zoom of the View and set it to View.right - GUIBox.width. Is there a more efficient way to do this ?

Thank you for reading!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SOLVED]Seperate Views or Area of View
« Reply #1 on: June 05, 2011, 08:29:20 pm »
You can use multiple views -- one for your app and one for the GUI.
Laurent Gomila - SFML developer

Nyran

  • Newbie
  • *
  • Posts: 2
    • View Profile
[SOLVED]Seperate Views or Area of View
« Reply #2 on: June 11, 2011, 06:09:30 pm »
Sorry for responsing late, the different views work perfectly together, now I can delete my resize-functions :>.

Thank you very much!