Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XNA: What is Viewport?

Tags:

c#

viewport

xna

In terms of 2D I don't understand what a viewport is and what it is used for. I am trying to build a side-scroller and believe I need the viewport for the map scrolling part.

like image 336
Bob Avatar asked Dec 22 '22 09:12

Bob


1 Answers

Consider a Tv displaying a scene, the viewport is simply the area of the scene that is captured by the camera.

Another way of thinking about it is the way some cameraman hold up their thumbs and index fingers to 'frame' a scene, or hold up a hollow picture frame, the light that passes through that frame is the viewport.

For a visual example, consider this gif, the green rectangle is the viewport: enter image description here

like image 111
Russ Clarke Avatar answered Dec 24 '22 01:12

Russ Clarke