4
« on: September 11, 2011, 10:02:35 am »
I'm very new to SFML, and am trying to wrap my head around how views are supposed to be used/understood.
Mostly I am a confused about point of reference, and relationship between SFML objects. I went through the view tutorial, and then downloaded and compiled the source at the bottom of the tutorial.
In the example, it says that the sizes of the two views (the user created, and default view) are the same. However, the background sprite is resized so that it is larger than both. My question, is where is the background 'drawn to', and what is the point of 2 views if you only ever actually 'view' one of them.
The ordering is throwing me off. First you create the background sprite, and its resized. Then you create the alternate view, with the same dimensions as the RenderWindow. Then you move the alternate view (im guessing in relation to the default view). You set the alternate as the default, and then draw to the window (or the view?). Right here everything starts breaking down for me. First, theres no room for the background sprite if we are drawing to a view, so I imagine the edges would be lopped off. But they are not.
Now we switch back to the default view, and draw the overlay (to the view?).
In the comments, when the alternate view is created, theres a mention of setting the center and halfsize's in relation to the background sprite. Why I see the relationship between the dimensions used, and the positions... but this all begs the question, what are these views views of? I am not seeing a clear relationship between the two views (if its a child-parent relationship).
If I had a few more examples of view scrolling maybe i'd understand.