<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.htm"><span>Main Page</span></a></li>
<li><a href="modules.htm"><span>Modules</span></a></li>
<li class="current"><a href="annotated.htm"><span>Classes</span></a></li>
<li><a href="files.htm"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.htm"><span>Class List</span></a></li>
<li><a href="classes.htm"><span>Class Index</span></a></li>
<li><a href="hierarchy.htm"><span>Class Hierarchy</span></a></li>
<li><a href="functions.htm"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1View.htm">View</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classsf_1_1View-members.htm">List of all members</a> </div>
<div class="headertitle">
<div class="title">sf::View Class Reference<div class="ingroups"><a class="el" href="group__graphics.htm">Graphics module</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>2D camera that defines what region is shown on screen
<a href="classsf_1_1View.htm#details">More...</a></p>
<p><code>#include <<a class="el" href="View_8hpp_source.htm">View.hpp</a>></code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a28c38308ff089ae5bdacd001d12286d3"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a28c38308ff089ae5bdacd001d12286d3">View</a> ()</td></tr>
<tr class="memdesc:a28c38308ff089ae5bdacd001d12286d3"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a28c38308ff089ae5bdacd001d12286d3"></a><br/></td></tr>
<tr class="separator:a28c38308ff089ae5bdacd001d12286d3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1d63bc49e041b3b1ff992bb6430e1326"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a1d63bc49e041b3b1ff992bb6430e1326">View</a> (const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> &rectangle)</td></tr>
<tr class="memdesc:a1d63bc49e041b3b1ff992bb6430e1326"><td class="mdescLeft"> </td><td class="mdescRight">Construct the view from a rectangle. <a href="#a1d63bc49e041b3b1ff992bb6430e1326"></a><br/></td></tr>
<tr class="separator:a1d63bc49e041b3b1ff992bb6430e1326"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afdaf84cfc910ef160450d63603457ea4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#afdaf84cfc910ef160450d63603457ea4">View</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> ¢er, const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> &size)</td></tr>
<tr class="memdesc:afdaf84cfc910ef160450d63603457ea4"><td class="mdescLeft"> </td><td class="mdescRight">Construct the view from its center and size. <a href="#afdaf84cfc910ef160450d63603457ea4"></a><br/></td></tr>
<tr class="separator:afdaf84cfc910ef160450d63603457ea4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa8e3fedb008306ff9811163545fb75f2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2">setCenter</a> (float x, float y)</td></tr>
<tr class="memdesc:aa8e3fedb008306ff9811163545fb75f2"><td class="mdescLeft"> </td><td class="mdescRight">Set the center of the view. <a href="#aa8e3fedb008306ff9811163545fb75f2"></a><br/></td></tr>
<tr class="separator:aa8e3fedb008306ff9811163545fb75f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab0296b03793e0873e6ae9e15311f3e78"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#ab0296b03793e0873e6ae9e15311f3e78">setCenter</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> ¢er)</td></tr>
<tr class="memdesc:ab0296b03793e0873e6ae9e15311f3e78"><td class="mdescLeft"> </td><td class="mdescRight">Set the center of the view. <a href="#ab0296b03793e0873e6ae9e15311f3e78"></a><br/></td></tr>
<tr class="separator:ab0296b03793e0873e6ae9e15311f3e78"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9525b73fe9fbaceb9568faf56b399dab"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab">setSize</a> (float width, float height)</td></tr>
<tr class="memdesc:a9525b73fe9fbaceb9568faf56b399dab"><td class="mdescLeft"> </td><td class="mdescRight">Set the size of the view. <a href="#a9525b73fe9fbaceb9568faf56b399dab"></a><br/></td></tr>
<tr class="separator:a9525b73fe9fbaceb9568faf56b399dab"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a9e08d471ce21aa0e69ce55ff9de66d29">setSize</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> &size)</td></tr>
<tr class="memdesc:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="mdescLeft"> </td><td class="mdescRight">Set the size of the view. <a href="#a9e08d471ce21aa0e69ce55ff9de66d29"></a><br/></td></tr>
<tr class="separator:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a24d0503c9c51f5ef5918612786d325c1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a24d0503c9c51f5ef5918612786d325c1">setRotation</a> (float angle)</td></tr>
<tr class="memdesc:a24d0503c9c51f5ef5918612786d325c1"><td class="mdescLeft"> </td><td class="mdescRight">Set the orientation of the view. <a href="#a24d0503c9c51f5ef5918612786d325c1"></a><br/></td></tr>
<tr class="separator:a24d0503c9c51f5ef5918612786d325c1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8eaec46b7d332fe834f016d0187d4b4a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a8eaec46b7d332fe834f016d0187d4b4a">setViewport</a> (const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> &viewport)</td></tr>
<tr class="memdesc:a8eaec46b7d332fe834f016d0187d4b4a"><td class="mdescLeft"> </td><td class="mdescRight">Set the target viewport. <a href="#a8eaec46b7d332fe834f016d0187d4b4a"></a><br/></td></tr>
<tr class="separator:a8eaec46b7d332fe834f016d0187d4b4a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac95b636eafab3922b7e8304fb6c00d7d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#ac95b636eafab3922b7e8304fb6c00d7d">reset</a> (const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> &rectangle)</td></tr>
<tr class="memdesc:ac95b636eafab3922b7e8304fb6c00d7d"><td class="mdescLeft"> </td><td class="mdescRight">Reset the view to the given rectangle. <a href="#ac95b636eafab3922b7e8304fb6c00d7d"></a><br/></td></tr>
<tr class="separator:ac95b636eafab3922b7e8304fb6c00d7d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adae81dede405b91bb3c487e28f536fe9"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9">getCenter</a> () const </td></tr>
<tr class="memdesc:adae81dede405b91bb3c487e28f536fe9"><td class="mdescLeft"> </td><td class="mdescRight">Get the center of the view. <a href="#adae81dede405b91bb3c487e28f536fe9"></a><br/></td></tr>
<tr class="separator:adae81dede405b91bb3c487e28f536fe9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aa130cf34676d715242bee661537a6257"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#aa130cf34676d715242bee661537a6257">getSize</a> () const </td></tr>
<tr class="memdesc:aa130cf34676d715242bee661537a6257"><td class="mdescLeft"> </td><td class="mdescRight">Get the size of the view. <a href="#aa130cf34676d715242bee661537a6257"></a><br/></td></tr>
<tr class="separator:aa130cf34676d715242bee661537a6257"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ad320469a27f96f6f49de1c14f0978d"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a8ad320469a27f96f6f49de1c14f0978d">getRotation</a> () const </td></tr>
<tr class="memdesc:a8ad320469a27f96f6f49de1c14f0978d"><td class="mdescLeft"> </td><td class="mdescRight">Get the current orientation of the view. <a href="#a8ad320469a27f96f6f49de1c14f0978d"></a><br/></td></tr>
<tr class="separator:a8ad320469a27f96f6f49de1c14f0978d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af1db1e4f21d104a9691fd38be9165758"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#af1db1e4f21d104a9691fd38be9165758">getViewport</a> () const </td></tr>
<tr class="memdesc:af1db1e4f21d104a9691fd38be9165758"><td class="mdescLeft"> </td><td class="mdescRight">Get the target viewport rectangle of the view. <a href="#af1db1e4f21d104a9691fd38be9165758"></a><br/></td></tr>
<tr class="separator:af1db1e4f21d104a9691fd38be9165758"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0c82144b837caf812f7cb25a43d80c41"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a0c82144b837caf812f7cb25a43d80c41">move</a> (float offsetX, float offsetY)</td></tr>
<tr class="memdesc:a0c82144b837caf812f7cb25a43d80c41"><td class="mdescLeft"> </td><td class="mdescRight">Move the view relatively to its current position. <a href="#a0c82144b837caf812f7cb25a43d80c41"></a><br/></td></tr>
<tr class="separator:a0c82144b837caf812f7cb25a43d80c41"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4c98a6e04fed756dfaff8f629de50862"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a4c98a6e04fed756dfaff8f629de50862">move</a> (const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> &offset)</td></tr>
<tr class="memdesc:a4c98a6e04fed756dfaff8f629de50862"><td class="mdescLeft"> </td><td class="mdescRight">Move the view relatively to its current position. <a href="#a4c98a6e04fed756dfaff8f629de50862"></a><br/></td></tr>
<tr class="separator:a4c98a6e04fed756dfaff8f629de50862"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5fd3901aae1845586ca40add94faa378"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a5fd3901aae1845586ca40add94faa378">rotate</a> (float angle)</td></tr>
<tr class="memdesc:a5fd3901aae1845586ca40add94faa378"><td class="mdescLeft"> </td><td class="mdescRight">Rotate the view relatively to its current orientation. <a href="#a5fd3901aae1845586ca40add94faa378"></a><br/></td></tr>
<tr class="separator:a5fd3901aae1845586ca40add94faa378"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a4a72a360a5792fbe4e99cd6feaf7726e">zoom</a> (float factor)</td></tr>
<tr class="memdesc:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="mdescLeft"> </td><td class="mdescRight">Resize the view rectangle relatively to its current size. <a href="#a4a72a360a5792fbe4e99cd6feaf7726e"></a><br/></td></tr>
<tr class="separator:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0109dba48aee769126f670a212b3ed7f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.htm">Transform</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#a0109dba48aee769126f670a212b3ed7f">getTransform</a> () const </td></tr>
<tr class="memdesc:a0109dba48aee769126f670a212b3ed7f"><td class="mdescLeft"> </td><td class="mdescRight">Get the projection transform of the view. <a href="#a0109dba48aee769126f670a212b3ed7f"></a><br/></td></tr>
<tr class="separator:a0109dba48aee769126f670a212b3ed7f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae7643324b2d8807cf0d9efe9dadfc8cc"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.htm">Transform</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.htm#ae7643324b2d8807cf0d9efe9dadfc8cc">getInverseTransform</a> () const </td></tr>
<tr class="memdesc:ae7643324b2d8807cf0d9efe9dadfc8cc"><td class="mdescLeft"> </td><td class="mdescRight">Get the inverse projection transform of the view. <a href="#ae7643324b2d8807cf0d9efe9dadfc8cc"></a><br/></td></tr>
<tr class="separator:ae7643324b2d8807cf0d9efe9dadfc8cc"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>2D camera that defines what region is shown on screen </p>
<p><a class="el" href="classsf_1_1View.htm" title="2D camera that defines what region is shown on screen">sf::View</a> defines a camera in the 2D scene.</p>
<p>This is a very powerful concept: you can scroll, rotate or zoom the entire scene without altering the way that your drawable objects are drawn.</p>
<p>A view is composed of a source rectangle, which defines what part of the 2D scene is shown, and a target viewport, which defines where the contents of the source rectangle will be displayed on the render target (window or texture).</p>
<p>The viewport allows to map the scene to a custom part of the render target, and can be used for split-screen or for displaying a minimap, for example. If the source rectangle has not the same size as the viewport, its contents will be stretched to fit in.</p>
<p>To apply a view, you have to assign it to the render target. Then, every objects drawn in this render target will be affected by the view until you use another view.</p>
<p>Usage example: </p>
<div class="fragment"><div class="line"><a class="code" href="classsf_1_1RenderWindow.htm" title="Window that can serve as a target for 2D drawing.">sf::RenderWindow</a> window;</div>
<div class="line"><a class="code" href="classsf_1_1View.htm" title="2D camera that defines what region is shown on screen">sf::View</a> view;</div>
<div class="line"></div>
<div class="line"><span class="comment">// Initialize the view to a rectangle located at (100, 100) and with a size of 400x200</span></div>
<div class="line">view.<a class="code" href="classsf_1_1View.htm#ac95b636eafab3922b7e8304fb6c00d7d" title="Reset the view to the given rectangle.">reset</a>(<a class="code" href="classsf_1_1Rect.htm">sf::FloatRect</a>(100, 100, 400, 200));</div>
<div class="line"></div>
<div class="line"><span class="comment">// Rotate it by 45 degrees</span></div>
<div class="line">view.<a class="code" href="classsf_1_1View.htm#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation.">rotate</a>(45);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Set its target viewport to be half of the window</span></div>
<div class="line">view.<a class="code" href="classsf_1_1View.htm#a8eaec46b7d332fe834f016d0187d4b4a" title="Set the target viewport.">setViewport</a>(<a class="code" href="classsf_1_1Rect.htm">sf::FloatRect</a>(0.f, 0.f, 0.5f, 1.f));</div>
<div class="line"></div>
<div class="line"><span class="comment">// Apply it</span></div>
<div class="line">window.<a class="code" href="classsf_1_1RenderTarget.htm#a063db6dd0a14913504af30e50cb6d946" title="Change the current active view.">setView</a>(view);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Render stuff</span></div>
<div class="line">window.<a class="code" href="classsf_1_1RenderTarget.htm#a12417a3bcc245c41d957b29583556f39" title="Draw a drawable object to the render-target.">draw</a>(someSprite);</div>
<div class="line"></div>
<div class="line"><span class="comment">// Set the default view back</span></div>
<div class="line">window.<a class="code" href="classsf_1_1RenderTarget.htm#a063db6dd0a14913504af30e50cb6d946" title="Change the current active view.">setView</a>(window.<a class="code" href="classsf_1_1RenderTarget.htm#a718b1aa6296bf855171699cc18251ced" title="Get the default view of the render target.">getDefaultView</a>());</div>
<div class="line"></div>
<div class="line"><span class="comment">// Render stuff not affected by the view</span></div>
<div class="line">window.<a class="code" href="classsf_1_1RenderTarget.htm#a12417a3bcc245c41d957b29583556f39" title="Draw a drawable object to the render-target.">draw</a>(someText);</div>
</div><!-- fragment --><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1RenderWindow.htm" title="Window that can serve as a target for 2D drawing.">sf::RenderWindow</a>, <a class="el" href="classsf_1_1RenderTexture.htm" title="Target for off-screen 2D rendering into a texture.">sf::RenderTexture</a> </dd></dl>
<p>Definition at line <a class="el" href="View_8hpp_source.htm#l00043">43</a> of file <a class="el" href="View_8hpp_source.htm">View.hpp</a>.</p>
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a28c38308ff089ae5bdacd001d12286d3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::View::View </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<p>This constructor creates a default view of (0, 0, 1000, 1000) </p>
</div>
</div>
<a class="anchor" id="a1d63bc49e041b3b1ff992bb6430e1326"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">sf::View::View </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> & </td>
<td class="paramname"><em>rectangle</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the view from a rectangle. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rectangle</td><td>Rectangle defining the zone to display </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="afdaf84cfc910ef160450d63603457ea4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::View::View </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td>
<td class="paramname"><em>center</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the view from its center and size. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">center</td><td>Center of the zone to display </td></tr>
<tr><td class="paramname">size</td><td>Size of zone to display </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="adae81dede405b91bb3c487e28f536fe9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a>& sf::View::getCenter </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the center of the view. </p>
<dl class="section return"><dt>Returns</dt><dd>Center of the view</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa130cf34676d715242bee661537a6257" title="Get the size of the view.">getSize</a>, <a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ae7643324b2d8807cf0d9efe9dadfc8cc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.htm">Transform</a>& sf::View::getInverseTransform </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the inverse projection transform of the view. </p>
<p>This function is meant for internal use only.</p>
<dl class="section return"><dt>Returns</dt><dd>Inverse of the projection transform defining the view</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a0109dba48aee769126f670a212b3ed7f" title="Get the projection transform of the view.">getTransform</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a8ad320469a27f96f6f49de1c14f0978d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float sf::View::getRotation </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current orientation of the view. </p>
<dl class="section return"><dt>Returns</dt><dd>Rotation angle of the view, in degrees</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view.">setRotation</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa130cf34676d715242bee661537a6257"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a>& sf::View::getSize </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the size of the view. </p>
<dl class="section return"><dt>Returns</dt><dd>Size of the view</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9" title="Get the center of the view.">getCenter</a>, <a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view.">setSize</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a0109dba48aee769126f670a212b3ed7f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.htm">Transform</a>& sf::View::getTransform </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the projection transform of the view. </p>
<p>This function is meant for internal use only.</p>
<dl class="section return"><dt>Returns</dt><dd>Projection transform defining the view</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#ae7643324b2d8807cf0d9efe9dadfc8cc" title="Get the inverse projection transform of the view.">getInverseTransform</a> </dd></dl>
</div>
</div>
<a class="anchor" id="af1db1e4f21d104a9691fd38be9165758"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a>& sf::View::getViewport </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the target viewport rectangle of the view. </p>
<dl class="section return"><dt>Returns</dt><dd>Viewport rectangle, expressed as a factor of the target size</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a8eaec46b7d332fe834f016d0187d4b4a" title="Set the target viewport.">setViewport</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a0c82144b837caf812f7cb25a43d80c41"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::move </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>offsetX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>offsetY</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Move the view relatively to its current position. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">offsetX</td><td>X coordinate of the move offset </td></tr>
<tr><td class="paramname">offsetY</td><td>Y coordinate of the move offset</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a>, <a class="el" href="classsf_1_1View.htm#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation.">rotate</a>, <a class="el" href="classsf_1_1View.htm#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size.">zoom</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a4c98a6e04fed756dfaff8f629de50862"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::move </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td>
<td class="paramname"><em>offset</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Move the view relatively to its current position. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">offset</td><td>Move offset</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a>, <a class="el" href="classsf_1_1View.htm#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation.">rotate</a>, <a class="el" href="classsf_1_1View.htm#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size.">zoom</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ac95b636eafab3922b7e8304fb6c00d7d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::reset </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> & </td>
<td class="paramname"><em>rectangle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reset the view to the given rectangle. </p>
<p>Note that this function resets the rotation angle to 0.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rectangle</td><td>Rectangle defining the zone to display</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a>, <a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view.">setSize</a>, <a class="el" href="classsf_1_1View.htm#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view.">setRotation</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a5fd3901aae1845586ca40add94faa378"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::rotate </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>angle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Rotate the view relatively to its current orientation. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>Angle to rotate, in degrees</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view.">setRotation</a>, <a class="el" href="classsf_1_1View.htm#a0c82144b837caf812f7cb25a43d80c41" title="Move the view relatively to its current position.">move</a>, <a class="el" href="classsf_1_1View.htm#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size.">zoom</a> </dd></dl>
</div>
</div>
<a class="anchor" id="aa8e3fedb008306ff9811163545fb75f2"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setCenter </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>y</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the center of the view. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>X coordinate of the new center </td></tr>
<tr><td class="paramname">y</td><td>Y coordinate of the new center</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view.">setSize</a>, <a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9" title="Get the center of the view.">getCenter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ab0296b03793e0873e6ae9e15311f3e78"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setCenter </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td>
<td class="paramname"><em>center</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the center of the view. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">center</td><td>New center</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view.">setSize</a>, <a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9" title="Get the center of the view.">getCenter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a24d0503c9c51f5ef5918612786d325c1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setRotation </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>angle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the orientation of the view. </p>
<p>The default rotation of a view is 0 degree.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>New angle, in degrees</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a8ad320469a27f96f6f49de1c14f0978d" title="Get the current orientation of the view.">getRotation</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a9525b73fe9fbaceb9568faf56b399dab"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setSize </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"><em>height</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the size of the view. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">width</td><td>New width of the view </td></tr>
<tr><td class="paramname">height</td><td>New height of the view</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a>, <a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9" title="Get the center of the view.">getCenter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a9e08d471ce21aa0e69ce55ff9de66d29"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setSize </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.htm">Vector2f</a> & </td>
<td class="paramname"><em>size</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the size of the view. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">size</td><td>New size</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view.">setCenter</a>, <a class="el" href="classsf_1_1View.htm#adae81dede405b91bb3c487e28f536fe9" title="Get the center of the view.">getCenter</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a8eaec46b7d332fe834f016d0187d4b4a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setViewport </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.htm">FloatRect</a> & </td>
<td class="paramname"><em>viewport</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the target viewport. </p>
<p>The viewport is the rectangle into which the contents of the view are displayed, expressed as a factor (between 0 and 1) of the size of the <a class="el" href="classsf_1_1RenderTarget.htm" title="Base class for all render targets (window, texture, ...)">RenderTarget</a> to which the view is applied. For example, a view which takes the left side of the target would be defined with <a class="el" href="classsf_1_1View.htm#a8eaec46b7d332fe834f016d0187d4b4a" title="Set the target viewport.">View.setViewport</a>(sf::FloatRect(0, 0, 0.5, 1)). By default, a view has a viewport which covers the entire target.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">viewport</td><td>New viewport rectangle</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#af1db1e4f21d104a9691fd38be9165758" title="Get the target viewport rectangle of the view.">getViewport</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a4a72a360a5792fbe4e99cd6feaf7726e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::zoom </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"><em>factor</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Resize the view rectangle relatively to its current size. </p>
<p>Resizing the view simulates a zoom, as the zone displayed on screen grows or shrinks. <em>factor</em> is a multiplier: </p>
<ul>
<li>1 keeps the size unchanged </li>
<li>> 1 makes the view bigger (objects appear smaller) </li>
<li>< 1 makes the view smaller (objects appear bigger)</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">factor</td><td>Zoom factor to apply</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classsf_1_1View.htm#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view.">setSize</a>, <a class="el" href="classsf_1_1View.htm#a0c82144b837caf812f7cb25a43d80c41" title="Move the view relatively to its current position.">move</a>, <a class="el" href="classsf_1_1View.htm#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation.">rotate</a> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="View_8hpp_source.htm">View.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
Copyright � Laurent Gomila ::
</div>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41898676-1', 'srchub.org');
ga('send', 'pageview');