vectozavr-shooter/SFML-mingw32/doc/html/classsf_1_1View.html

704 lines
43 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.5.1</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.14 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;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.html">View</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsf_1_1View-members.html">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.html">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.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="View_8hpp_source.html">View.hpp</a>&gt;</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">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a28c38308ff089ae5bdacd001d12286d3">View</a> ()</td></tr>
<tr class="memdesc:a28c38308ff089ae5bdacd001d12286d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#a28c38308ff089ae5bdacd001d12286d3">More...</a><br /></td></tr>
<tr class="separator:a28c38308ff089ae5bdacd001d12286d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d63bc49e041b3b1ff992bb6430e1326"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a1d63bc49e041b3b1ff992bb6430e1326">View</a> (const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;rectangle)</td></tr>
<tr class="memdesc:a1d63bc49e041b3b1ff992bb6430e1326"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the view from a rectangle. <a href="#a1d63bc49e041b3b1ff992bb6430e1326">More...</a><br /></td></tr>
<tr class="separator:a1d63bc49e041b3b1ff992bb6430e1326"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afdaf84cfc910ef160450d63603457ea4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#afdaf84cfc910ef160450d63603457ea4">View</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;center, const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;size)</td></tr>
<tr class="memdesc:afdaf84cfc910ef160450d63603457ea4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the view from its center and size. <a href="#afdaf84cfc910ef160450d63603457ea4">More...</a><br /></td></tr>
<tr class="separator:afdaf84cfc910ef160450d63603457ea4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8e3fedb008306ff9811163545fb75f2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#aa8e3fedb008306ff9811163545fb75f2">setCenter</a> (float x, float y)</td></tr>
<tr class="memdesc:aa8e3fedb008306ff9811163545fb75f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the center of the view. <a href="#aa8e3fedb008306ff9811163545fb75f2">More...</a><br /></td></tr>
<tr class="separator:aa8e3fedb008306ff9811163545fb75f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0296b03793e0873e6ae9e15311f3e78"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#ab0296b03793e0873e6ae9e15311f3e78">setCenter</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;center)</td></tr>
<tr class="memdesc:ab0296b03793e0873e6ae9e15311f3e78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the center of the view. <a href="#ab0296b03793e0873e6ae9e15311f3e78">More...</a><br /></td></tr>
<tr class="separator:ab0296b03793e0873e6ae9e15311f3e78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9525b73fe9fbaceb9568faf56b399dab"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a9525b73fe9fbaceb9568faf56b399dab">setSize</a> (float width, float height)</td></tr>
<tr class="memdesc:a9525b73fe9fbaceb9568faf56b399dab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the size of the view. <a href="#a9525b73fe9fbaceb9568faf56b399dab">More...</a><br /></td></tr>
<tr class="separator:a9525b73fe9fbaceb9568faf56b399dab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a9e08d471ce21aa0e69ce55ff9de66d29">setSize</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;size)</td></tr>
<tr class="memdesc:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the size of the view. <a href="#a9e08d471ce21aa0e69ce55ff9de66d29">More...</a><br /></td></tr>
<tr class="separator:a9e08d471ce21aa0e69ce55ff9de66d29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24d0503c9c51f5ef5918612786d325c1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a24d0503c9c51f5ef5918612786d325c1">setRotation</a> (float angle)</td></tr>
<tr class="memdesc:a24d0503c9c51f5ef5918612786d325c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the orientation of the view. <a href="#a24d0503c9c51f5ef5918612786d325c1">More...</a><br /></td></tr>
<tr class="separator:a24d0503c9c51f5ef5918612786d325c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8eaec46b7d332fe834f016d0187d4b4a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a8eaec46b7d332fe834f016d0187d4b4a">setViewport</a> (const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;viewport)</td></tr>
<tr class="memdesc:a8eaec46b7d332fe834f016d0187d4b4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the target viewport. <a href="#a8eaec46b7d332fe834f016d0187d4b4a">More...</a><br /></td></tr>
<tr class="separator:a8eaec46b7d332fe834f016d0187d4b4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac95b636eafab3922b7e8304fb6c00d7d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#ac95b636eafab3922b7e8304fb6c00d7d">reset</a> (const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;rectangle)</td></tr>
<tr class="memdesc:ac95b636eafab3922b7e8304fb6c00d7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the view to the given rectangle. <a href="#ac95b636eafab3922b7e8304fb6c00d7d">More...</a><br /></td></tr>
<tr class="separator:ac95b636eafab3922b7e8304fb6c00d7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f4443c194c691ae4dcf8fd9dd0eaa46"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a7f4443c194c691ae4dcf8fd9dd0eaa46">getCenter</a> () const</td></tr>
<tr class="memdesc:a7f4443c194c691ae4dcf8fd9dd0eaa46"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the center of the view. <a href="#a7f4443c194c691ae4dcf8fd9dd0eaa46">More...</a><br /></td></tr>
<tr class="separator:a7f4443c194c691ae4dcf8fd9dd0eaa46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5432748dd3a78ac4019dfbde208c7cc1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a5432748dd3a78ac4019dfbde208c7cc1">getSize</a> () const</td></tr>
<tr class="memdesc:a5432748dd3a78ac4019dfbde208c7cc1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of the view. <a href="#a5432748dd3a78ac4019dfbde208c7cc1">More...</a><br /></td></tr>
<tr class="separator:a5432748dd3a78ac4019dfbde208c7cc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a324d8885f4ab17f1f7b0313580c9b84e"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a324d8885f4ab17f1f7b0313580c9b84e">getRotation</a> () const</td></tr>
<tr class="memdesc:a324d8885f4ab17f1f7b0313580c9b84e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current orientation of the view. <a href="#a324d8885f4ab17f1f7b0313580c9b84e">More...</a><br /></td></tr>
<tr class="separator:a324d8885f4ab17f1f7b0313580c9b84e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93859b4e2e8c191ec741731211a0fb12"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a93859b4e2e8c191ec741731211a0fb12">getViewport</a> () const</td></tr>
<tr class="memdesc:a93859b4e2e8c191ec741731211a0fb12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the target viewport rectangle of the view. <a href="#a93859b4e2e8c191ec741731211a0fb12">More...</a><br /></td></tr>
<tr class="separator:a93859b4e2e8c191ec741731211a0fb12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c82144b837caf812f7cb25a43d80c41"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a0c82144b837caf812f7cb25a43d80c41">move</a> (float offsetX, float offsetY)</td></tr>
<tr class="memdesc:a0c82144b837caf812f7cb25a43d80c41"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the view relatively to its current position. <a href="#a0c82144b837caf812f7cb25a43d80c41">More...</a><br /></td></tr>
<tr class="separator:a0c82144b837caf812f7cb25a43d80c41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c98a6e04fed756dfaff8f629de50862"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a4c98a6e04fed756dfaff8f629de50862">move</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;offset)</td></tr>
<tr class="memdesc:a4c98a6e04fed756dfaff8f629de50862"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the view relatively to its current position. <a href="#a4c98a6e04fed756dfaff8f629de50862">More...</a><br /></td></tr>
<tr class="separator:a4c98a6e04fed756dfaff8f629de50862"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5fd3901aae1845586ca40add94faa378"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a5fd3901aae1845586ca40add94faa378">rotate</a> (float angle)</td></tr>
<tr class="memdesc:a5fd3901aae1845586ca40add94faa378"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotate the view relatively to its current orientation. <a href="#a5fd3901aae1845586ca40add94faa378">More...</a><br /></td></tr>
<tr class="separator:a5fd3901aae1845586ca40add94faa378"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a4a72a360a5792fbe4e99cd6feaf7726e">zoom</a> (float factor)</td></tr>
<tr class="memdesc:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resize the view rectangle relatively to its current size. <a href="#a4a72a360a5792fbe4e99cd6feaf7726e">More...</a><br /></td></tr>
<tr class="separator:a4a72a360a5792fbe4e99cd6feaf7726e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13da786526688bf99dc2cd3e658a3c2a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#a13da786526688bf99dc2cd3e658a3c2a">getTransform</a> () const</td></tr>
<tr class="memdesc:a13da786526688bf99dc2cd3e658a3c2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the projection transform of the view. <a href="#a13da786526688bf99dc2cd3e658a3c2a">More...</a><br /></td></tr>
<tr class="separator:a13da786526688bf99dc2cd3e658a3c2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd2b001cf2a646f62e7d9e792d7d5f0d"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1View.html#acd2b001cf2a646f62e7d9e792d7d5f0d">getInverseTransform</a> () const</td></tr>
<tr class="memdesc:acd2b001cf2a646f62e7d9e792d7d5f0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the inverse projection transform of the view. <a href="#acd2b001cf2a646f62e7d9e792d7d5f0d">More...</a><br /></td></tr>
<tr class="separator:acd2b001cf2a646f62e7d9e792d7d5f0d"><td class="memSeparator" colspan="2">&#160;</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.html" 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 doesn't have 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, 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.html">sf::RenderWindow</a> window;</div><div class="line"><a class="code" href="classsf_1_1View.html">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.html#ac95b636eafab3922b7e8304fb6c00d7d">reset</a>(<a class="code" href="classsf_1_1Rect.html">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.html#a5fd3901aae1845586ca40add94faa378">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.html#a8eaec46b7d332fe834f016d0187d4b4a">setViewport</a>(<a class="code" href="classsf_1_1Rect.html">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.html#a063db6dd0a14913504af30e50cb6d946">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.html#a12417a3bcc245c41d957b29583556f39">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.html#a063db6dd0a14913504af30e50cb6d946">setView</a>(window.<a class="code" href="classsf_1_1RenderTarget.html#ad3b533c3f899d7044d981ed607aef9be">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.html#a12417a3bcc245c41d957b29583556f39">draw</a>(someText);</div></div><!-- fragment --><p>See also the note on coordinates and undistorted rendering in <a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale. ">sf::Transformable</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1RenderWindow.html" title="Window that can serve as a target for 2D drawing. ">sf::RenderWindow</a>, <a class="el" href="classsf_1_1RenderTexture.html" title="Target for off-screen 2D rendering into a texture. ">sf::RenderTexture</a> </dd></dl>
<p class="definition">Definition at line <a class="el" href="View_8hpp_source.html#l00043">43</a> of file <a class="el" href="View_8hpp_source.html">View.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a28c38308ff089ae5bdacd001d12286d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28c38308ff089ae5bdacd001d12286d3">&#9670;&nbsp;</a></span>View() <span class="overload">[1/3]</span></h2>
<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 id="a1d63bc49e041b3b1ff992bb6430e1326"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d63bc49e041b3b1ff992bb6430e1326">&#9670;&nbsp;</a></span>View() <span class="overload">[2/3]</span></h2>
<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.html">FloatRect</a> &amp;&#160;</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 id="afdaf84cfc910ef160450d63603457ea4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afdaf84cfc910ef160450d63603457ea4">&#9670;&nbsp;</a></span>View() <span class="overload">[3/3]</span></h2>
<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.html">Vector2f</a> &amp;&#160;</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.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>size</em>&#160;</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 id="a7f4443c194c691ae4dcf8fd9dd0eaa46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7f4443c194c691ae4dcf8fd9dd0eaa46">&#9670;&nbsp;</a></span>getCenter()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a>&amp; 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.html#a5432748dd3a78ac4019dfbde208c7cc1" title="Get the size of the view. ">getSize</a>, <a class="el" href="classsf_1_1View.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a> </dd></dl>
</div>
</div>
<a id="acd2b001cf2a646f62e7d9e792d7d5f0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd2b001cf2a646f62e7d9e792d7d5f0d">&#9670;&nbsp;</a></span>getInverseTransform()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; 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.html#a13da786526688bf99dc2cd3e658a3c2a" title="Get the projection transform of the view. ">getTransform</a> </dd></dl>
</div>
</div>
<a id="a324d8885f4ab17f1f7b0313580c9b84e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a324d8885f4ab17f1f7b0313580c9b84e">&#9670;&nbsp;</a></span>getRotation()</h2>
<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.html#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view. ">setRotation</a> </dd></dl>
</div>
</div>
<a id="a5432748dd3a78ac4019dfbde208c7cc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5432748dd3a78ac4019dfbde208c7cc1">&#9670;&nbsp;</a></span>getSize()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a>&amp; 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.html#a7f4443c194c691ae4dcf8fd9dd0eaa46" title="Get the center of the view. ">getCenter</a>, <a class="el" href="classsf_1_1View.html#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view. ">setSize</a> </dd></dl>
</div>
</div>
<a id="a13da786526688bf99dc2cd3e658a3c2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13da786526688bf99dc2cd3e658a3c2a">&#9670;&nbsp;</a></span>getTransform()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; 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.html#acd2b001cf2a646f62e7d9e792d7d5f0d" title="Get the inverse projection transform of the view. ">getInverseTransform</a> </dd></dl>
</div>
</div>
<a id="a93859b4e2e8c191ec741731211a0fb12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93859b4e2e8c191ec741731211a0fb12">&#9670;&nbsp;</a></span>getViewport()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Rect.html">FloatRect</a>&amp; 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.html#a8eaec46b7d332fe834f016d0187d4b4a" title="Set the target viewport. ">setViewport</a> </dd></dl>
</div>
</div>
<a id="a0c82144b837caf812f7cb25a43d80c41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c82144b837caf812f7cb25a43d80c41">&#9670;&nbsp;</a></span>move() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::move </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>offsetX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>offsetY</em>&#160;</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.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a>, <a class="el" href="classsf_1_1View.html#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation. ">rotate</a>, <a class="el" href="classsf_1_1View.html#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size. ">zoom</a> </dd></dl>
</div>
</div>
<a id="a4c98a6e04fed756dfaff8f629de50862"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c98a6e04fed756dfaff8f629de50862">&#9670;&nbsp;</a></span>move() <span class="overload">[2/2]</span></h2>
<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.html">Vector2f</a> &amp;&#160;</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.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a>, <a class="el" href="classsf_1_1View.html#a5fd3901aae1845586ca40add94faa378" title="Rotate the view relatively to its current orientation. ">rotate</a>, <a class="el" href="classsf_1_1View.html#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size. ">zoom</a> </dd></dl>
</div>
</div>
<a id="ac95b636eafab3922b7e8304fb6c00d7d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac95b636eafab3922b7e8304fb6c00d7d">&#9670;&nbsp;</a></span>reset()</h2>
<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.html">FloatRect</a> &amp;&#160;</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.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a>, <a class="el" href="classsf_1_1View.html#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view. ">setSize</a>, <a class="el" href="classsf_1_1View.html#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view. ">setRotation</a> </dd></dl>
</div>
</div>
<a id="a5fd3901aae1845586ca40add94faa378"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5fd3901aae1845586ca40add94faa378">&#9670;&nbsp;</a></span>rotate()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::rotate </td>
<td>(</td>
<td class="paramtype">float&#160;</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.html#a24d0503c9c51f5ef5918612786d325c1" title="Set the orientation of the view. ">setRotation</a>, <a class="el" href="classsf_1_1View.html#a0c82144b837caf812f7cb25a43d80c41" title="Move the view relatively to its current position. ">move</a>, <a class="el" href="classsf_1_1View.html#a4a72a360a5792fbe4e99cd6feaf7726e" title="Resize the view rectangle relatively to its current size. ">zoom</a> </dd></dl>
</div>
</div>
<a id="aa8e3fedb008306ff9811163545fb75f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8e3fedb008306ff9811163545fb75f2">&#9670;&nbsp;</a></span>setCenter() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setCenter </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>y</em>&#160;</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.html#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view. ">setSize</a>, <a class="el" href="classsf_1_1View.html#a7f4443c194c691ae4dcf8fd9dd0eaa46" title="Get the center of the view. ">getCenter</a> </dd></dl>
</div>
</div>
<a id="ab0296b03793e0873e6ae9e15311f3e78"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab0296b03793e0873e6ae9e15311f3e78">&#9670;&nbsp;</a></span>setCenter() <span class="overload">[2/2]</span></h2>
<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.html">Vector2f</a> &amp;&#160;</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.html#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view. ">setSize</a>, <a class="el" href="classsf_1_1View.html#a7f4443c194c691ae4dcf8fd9dd0eaa46" title="Get the center of the view. ">getCenter</a> </dd></dl>
</div>
</div>
<a id="a24d0503c9c51f5ef5918612786d325c1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24d0503c9c51f5ef5918612786d325c1">&#9670;&nbsp;</a></span>setRotation()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setRotation </td>
<td>(</td>
<td class="paramtype">float&#160;</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.html#a324d8885f4ab17f1f7b0313580c9b84e" title="Get the current orientation of the view. ">getRotation</a> </dd></dl>
</div>
</div>
<a id="a9525b73fe9fbaceb9568faf56b399dab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9525b73fe9fbaceb9568faf56b399dab">&#9670;&nbsp;</a></span>setSize() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::setSize </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>width</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>height</em>&#160;</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.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a>, <a class="el" href="classsf_1_1View.html#a7f4443c194c691ae4dcf8fd9dd0eaa46" title="Get the center of the view. ">getCenter</a> </dd></dl>
</div>
</div>
<a id="a9e08d471ce21aa0e69ce55ff9de66d29"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e08d471ce21aa0e69ce55ff9de66d29">&#9670;&nbsp;</a></span>setSize() <span class="overload">[2/2]</span></h2>
<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.html">Vector2f</a> &amp;&#160;</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.html#aa8e3fedb008306ff9811163545fb75f2" title="Set the center of the view. ">setCenter</a>, <a class="el" href="classsf_1_1View.html#a7f4443c194c691ae4dcf8fd9dd0eaa46" title="Get the center of the view. ">getCenter</a> </dd></dl>
</div>
</div>
<a id="a8eaec46b7d332fe834f016d0187d4b4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8eaec46b7d332fe834f016d0187d4b4a">&#9670;&nbsp;</a></span>setViewport()</h2>
<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.html">FloatRect</a> &amp;&#160;</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.html" 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.html#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.html#a93859b4e2e8c191ec741731211a0fb12" title="Get the target viewport rectangle of the view. ">getViewport</a> </dd></dl>
</div>
</div>
<a id="a4a72a360a5792fbe4e99cd6feaf7726e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a72a360a5792fbe4e99cd6feaf7726e">&#9670;&nbsp;</a></span>zoom()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::View::zoom </td>
<td>(</td>
<td class="paramtype">float&#160;</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>&gt; 1 makes the view bigger (objects appear smaller) </li>
<li>&lt; 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.html#a9525b73fe9fbaceb9568faf56b399dab" title="Set the size of the view. ">setSize</a>, <a class="el" href="classsf_1_1View.html#a0c82144b837caf812f7cb25a43d80c41" title="Move the view relatively to its current position. ">move</a>, <a class="el" href="classsf_1_1View.html#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.html">View.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body>
</html>