Greeting all. Learned much in both C++ and SFML since I have been here last. My current project, though, would be much easier with views.
However, even after the doc and a tuturial I found regarding it (there was a forum post on here about it), and some attempts myself, I am very befuddled. In the game engine I had used previously, views were still a bit confusing at times, but simply consisted of variables like width/height of the view/viewport, and something along the lines of position. (top left corner, that is).
SFML views, though, have got me confused. So, I suppose, I can try to explain what I want to do.
What I want to do is, make the view the same size as the rendering region (and same for the viewport, but that is default). I then want this view to continue moving southEast-ish - that is, down and right - to follow a slope. Simply enough, you would think. At first, I first made it as simply sf::View view, and so center was 500/500. I later re-set the center, (as view height/2, view width/2) and this was better. (previously, a line that started at 0,0 was near the right of the screen, still at the top, when it should have been the top left - the view was somehow shifted right), but now looked as expected. Anyhow, this slope of mine is randomly generated. as such, if you use set incriments, you may either end up to far above, or to below, the slope. However, the camera will actually follow the player. I may impliment adding a zoom so the slope always stays in few, we shall see. Anyhow, currently (due to 'dropoffs" in the slope), I make it so if the view is further down then the highest point currently in view (more or less - technically, it is a point that was the highest when the last highest goes out of view), so when the player goes out of view, I can kill them and it isn't so ugly.
When I added this, though, the lines were there one second and gone the next. The y position went from 300.2 to -299.8, causing it to go out of view, I beleive. I just have no idea why. This prompted me to make this point - I figure things will all be easier if I understand just how allthe aspects of views work as they are implimented in SFML, specifically how the center works - what is it set relative to? How does it affect transformations?
So I suppose I am asking if somebody can go over each aspect of views and explain quite how they work, with emphasis on coordinates and the center.
I realize that is a bit general, but I feel it would all be useful information on a concept that, if the tuturial is any indication, and my own confusion at the lack in the documentation (setCenter is "set the center of the view", a fact I understand from the name but I don't really know exactly what that does, for exactly what it is relative from?)
Thanks if you can help clear this up for me at all.