SFML community forums

Help => Graphics => Topic started by: Stock on May 30, 2014, 05:02:43 pm

Title: Gve an sf::view a set size?
Post by: Stock on May 30, 2014, 05:02:43 pm
I was wondering if it is possible to set the size of a view and when the window is resized, the view does not change with it, I read through the API Doc and googled, and found nothing. I hope this was clear, thanks in advance.
Title: Re: Gve an sf::view a set size?
Post by: zsbzsb on May 30, 2014, 05:12:32 pm
http://www.sfml-dev.org/tutorials/2.1/graphics-view.php#showing-more-when-the-window-is-resized

I know, nothing is there about the subject  :)
Title: Re: Gve an sf::view a set size?
Post by: Stock on May 30, 2014, 05:57:28 pm
This actually does nothing...  or the same thing done by default. Which is the opposite of what I wanted, I want it to not scale itself.
Title: Re: Gve an sf::view a set size?
Post by: Laurent on May 30, 2014, 07:54:29 pm
This is exactly what it does. If you read what's written above the code, it's pretty clear that it's not the same as the default behaviour (what would be the point of showing a piece of code that does what SFML already does automatically?).
Title: Re: Gve an sf::view a set size?
Post by: Stock on May 30, 2014, 11:53:59 pm
I apologize, I made an error when implementing it. The title "Showing more when the window is resized" also threw me off a bit. I got it now though thank you.
Title: Re: Gve an sf::view a set size?
Post by: Stock on May 30, 2014, 11:57:34 pm
Instead of starting a new thread, this is semi related. Is it possible to have more than one view, or a more specific example, a background covering the whole window then a view which is the map, then a view to the side of the map, which would serve as an inventory section?

Simply put:
    Can I have more than one view active at a time?
Title: Re: Gve an sf::view a set size?
Post by: G. on May 30, 2014, 11:59:06 pm
Simply put: there is a tutorial about views.
Title: Re: Gve an sf::view a set size?
Post by: Stock on May 31, 2014, 12:50:03 am
I have been nothing but kind here; however, it seems that this community is full of anti-productive jerks. I try to explain problems clearly, I did some searching first, but communities are there for reasons, to help. The help section is there for a reason, to help. Pawing through all of the API documentation takes much longer than simply asking for help. In the help sections, you know, what they are for.
Title: Re: Gve an sf::view a set size?
Post by: G. on May 31, 2014, 01:20:42 am
Yes but the answer is in the official tutorial (http://www.sfml-dev.org/tutorials/2.1/graphics-view.php) linked by zsbzsb and it shows how to use multiple views. There even is a minimap example.
The doc (http://www.sfml-dev.org/documentation/2.1/classsf_1_1View.php) also shows in its detailed description and code how to use multiple views at the same time.
If you read the tutorial and have trouble understanding something, you can take a look at this other tutorial on the wiki (https://github.com/SFML/SFML/wiki/Tutorial:-Using-View) or ask question.

I don't think it's unrealistic to ask people to read the doc or tutorial of the class they want to use when they have a question which is already answered in both. The SFML team wrote tutorials and documentation but you don't want to read them (the description in the doc is barely 10 lines of text, 10 lines of code), doesn't that make you the anti-productive jerk?