2d-platformer/vendor/SFML/doc/html/classsf_1_1Sprite.html

1056 lines
67 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;charset=UTF-8" />
<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>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link rel="stylesheet" type="text/css" href="search/search.css" />
<link rel="stylesheet" type="text/css" href="searchOverrides.css" />
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 3.0.0</span>
</div>
</div>
<div id="content">
<div>
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="topics.html"><span>Topics</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>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</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>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacesf.html">sf</a></li><li class="navelem"><a class="el" href="classsf_1_1Sprite.html">Sprite</a></li> </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsf_1_1Sprite-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">sf::Sprite Class Reference<div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div></div>
</div><!--header-->
<div class="contents">
<p><a class="el" href="classsf_1_1Drawable.html" title="Abstract base class for objects that can be drawn to a render target.">Drawable</a> representation of a texture, with its own transformations, color, etc.
<a href="#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Sprite_8hpp_source.html">SFML/Graphics/Sprite.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for sf::Sprite:</div>
<div class="dyncontent">
<div class="center">
<img src="classsf_1_1Sprite.png" usemap="#sf::Sprite_map" alt=""/>
<map id="sf::Sprite_map" name="sf::Sprite_map">
<area href="classsf_1_1Drawable.html" title="Abstract base class for objects that can be drawn to a render target." alt="sf::Drawable" shape="rect" coords="0,0,109,24"/>
<area href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale." alt="sf::Transformable" shape="rect" coords="119,0,228,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a2a9fca374d7abf084bb1c143a879ff4a" id="r_a2a9fca374d7abf084bb1c143a879ff4a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2a9fca374d7abf084bb1c143a879ff4a">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;texture)</td></tr>
<tr class="memdesc:a2a9fca374d7abf084bb1c143a879ff4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the sprite from a source texture. <br /></td></tr>
<tr class="separator:a2a9fca374d7abf084bb1c143a879ff4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a435bce19c80d0e81e5b421497e6bc6b9" id="r_a435bce19c80d0e81e5b421497e6bc6b9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a435bce19c80d0e81e5b421497e6bc6b9">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;texture)=delete</td></tr>
<tr class="memdesc:a435bce19c80d0e81e5b421497e6bc6b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disallow construction from a temporary texture. <br /></td></tr>
<tr class="separator:a435bce19c80d0e81e5b421497e6bc6b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a01cfe1402372d243dbaa2ffa96020206" id="r_a01cfe1402372d243dbaa2ffa96020206"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a01cfe1402372d243dbaa2ffa96020206">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;texture, const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;rectangle)</td></tr>
<tr class="memdesc:a01cfe1402372d243dbaa2ffa96020206"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the sprite from a sub-rectangle of a source texture. <br /></td></tr>
<tr class="separator:a01cfe1402372d243dbaa2ffa96020206"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8b4b6d5a98e8fa6c09f146c04c0d472" id="r_aa8b4b6d5a98e8fa6c09f146c04c0d472"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8b4b6d5a98e8fa6c09f146c04c0d472">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;texture, const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;rectangle)=delete</td></tr>
<tr class="memdesc:aa8b4b6d5a98e8fa6c09f146c04c0d472"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disallow construction from a temporary texture. <br /></td></tr>
<tr class="separator:aa8b4b6d5a98e8fa6c09f146c04c0d472"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3729c88d88ac38c19317c18e87242560" id="r_a3729c88d88ac38c19317c18e87242560"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3729c88d88ac38c19317c18e87242560">setTexture</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;texture, bool resetRect=false)</td></tr>
<tr class="memdesc:a3729c88d88ac38c19317c18e87242560"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the source texture of the sprite. <br /></td></tr>
<tr class="separator:a3729c88d88ac38c19317c18e87242560"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ae0447240b8ddc93e74ed832c570409" id="r_a4ae0447240b8ddc93e74ed832c570409"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4ae0447240b8ddc93e74ed832c570409">setTexture</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;texture, bool resetRect=false)=delete</td></tr>
<tr class="memdesc:a4ae0447240b8ddc93e74ed832c570409"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disallow setting from a temporary texture. <br /></td></tr>
<tr class="separator:a4ae0447240b8ddc93e74ed832c570409"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fefec419a4e6a90c0fd54c793d82ec2" id="r_a3fefec419a4e6a90c0fd54c793d82ec2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3fefec419a4e6a90c0fd54c793d82ec2">setTextureRect</a> (const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;rectangle)</td></tr>
<tr class="memdesc:a3fefec419a4e6a90c0fd54c793d82ec2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the sub-rectangle of the texture that the sprite will display. <br /></td></tr>
<tr class="separator:a3fefec419a4e6a90c0fd54c793d82ec2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ce64c561193c124cd63d5adb1750ad4" id="r_a2ce64c561193c124cd63d5adb1750ad4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2ce64c561193c124cd63d5adb1750ad4">setColor</a> (<a class="el" href="classsf_1_1Color.html">Color</a> color)</td></tr>
<tr class="memdesc:a2ce64c561193c124cd63d5adb1750ad4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the global color of the sprite. <br /></td></tr>
<tr class="separator:a2ce64c561193c124cd63d5adb1750ad4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fa65388fd2751a8d4ca93722dabdd96" id="r_a1fa65388fd2751a8d4ca93722dabdd96"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1fa65388fd2751a8d4ca93722dabdd96">getTexture</a> () const</td></tr>
<tr class="memdesc:a1fa65388fd2751a8d4ca93722dabdd96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the source texture of the sprite. <br /></td></tr>
<tr class="separator:a1fa65388fd2751a8d4ca93722dabdd96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb19e5b4f39d17cf4d95752b3a79bcb6" id="r_afb19e5b4f39d17cf4d95752b3a79bcb6"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afb19e5b4f39d17cf4d95752b3a79bcb6">getTextureRect</a> () const</td></tr>
<tr class="memdesc:afb19e5b4f39d17cf4d95752b3a79bcb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the sub-rectangle of the texture displayed by the sprite. <br /></td></tr>
<tr class="separator:afb19e5b4f39d17cf4d95752b3a79bcb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54562d0a2d0a65a37829ee58ca02c289" id="r_a54562d0a2d0a65a37829ee58ca02c289"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Color.html">Color</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a54562d0a2d0a65a37829ee58ca02c289">getColor</a> () const</td></tr>
<tr class="memdesc:a54562d0a2d0a65a37829ee58ca02c289"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the global color of the sprite. <br /></td></tr>
<tr class="separator:a54562d0a2d0a65a37829ee58ca02c289"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2f4c781464da6f8a52b1df6058a48b8" id="r_ab2f4c781464da6f8a52b1df6058a48b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#a701020eb396e62ba560619e68c689a38">FloatRect</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab2f4c781464da6f8a52b1df6058a48b8">getLocalBounds</a> () const</td></tr>
<tr class="memdesc:ab2f4c781464da6f8a52b1df6058a48b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the local bounding rectangle of the entity. <br /></td></tr>
<tr class="separator:ab2f4c781464da6f8a52b1df6058a48b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa795483096b90745b2e799532963e271" id="r_aa795483096b90745b2e799532963e271"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#a701020eb396e62ba560619e68c689a38">FloatRect</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa795483096b90745b2e799532963e271">getGlobalBounds</a> () const</td></tr>
<tr class="memdesc:aa795483096b90745b2e799532963e271"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the global bounding rectangle of the entity. <br /></td></tr>
<tr class="separator:aa795483096b90745b2e799532963e271"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47c1375b57cbb0e513286e8d11f6dd4d" id="r_a47c1375b57cbb0e513286e8d11f6dd4d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a47c1375b57cbb0e513286e8d11f6dd4d">setPosition</a> (<a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> position)</td></tr>
<tr class="memdesc:a47c1375b57cbb0e513286e8d11f6dd4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">set the position of the object <br /></td></tr>
<tr class="separator:a47c1375b57cbb0e513286e8d11f6dd4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b4bfa83da965c03ef523c7c33df991f" id="r_a1b4bfa83da965c03ef523c7c33df991f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a1b4bfa83da965c03ef523c7c33df991f">setRotation</a> (<a class="el" href="classsf_1_1Angle.html">Angle</a> angle)</td></tr>
<tr class="memdesc:a1b4bfa83da965c03ef523c7c33df991f"><td class="mdescLeft">&#160;</td><td class="mdescRight">set the orientation of the object <br /></td></tr>
<tr class="separator:a1b4bfa83da965c03ef523c7c33df991f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60b82c58502e86f258c9844a1a58400b" id="r_a60b82c58502e86f258c9844a1a58400b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a60b82c58502e86f258c9844a1a58400b">setScale</a> (<a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> factors)</td></tr>
<tr class="memdesc:a60b82c58502e86f258c9844a1a58400b"><td class="mdescLeft">&#160;</td><td class="mdescRight">set the scale factors of the object <br /></td></tr>
<tr class="separator:a60b82c58502e86f258c9844a1a58400b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26788f72ade7ffadb8ba594c3332c4a8" id="r_a26788f72ade7ffadb8ba594c3332c4a8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a26788f72ade7ffadb8ba594c3332c4a8">setOrigin</a> (<a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> origin)</td></tr>
<tr class="memdesc:a26788f72ade7ffadb8ba594c3332c4a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">set the local origin of the object <br /></td></tr>
<tr class="separator:a26788f72ade7ffadb8ba594c3332c4a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88a224d0831261591beace74cd3ad67b" id="r_a88a224d0831261591beace74cd3ad67b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a88a224d0831261591beace74cd3ad67b">getPosition</a> () const</td></tr>
<tr class="memdesc:a88a224d0831261591beace74cd3ad67b"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the position of the object <br /></td></tr>
<tr class="separator:a88a224d0831261591beace74cd3ad67b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11ca740731d6c2cdde3cc8ae3bda3785" id="r_a11ca740731d6c2cdde3cc8ae3bda3785"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Angle.html">Angle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a11ca740731d6c2cdde3cc8ae3bda3785">getRotation</a> () const</td></tr>
<tr class="memdesc:a11ca740731d6c2cdde3cc8ae3bda3785"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the orientation of the object <br /></td></tr>
<tr class="separator:a11ca740731d6c2cdde3cc8ae3bda3785"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86fe2b0a7479713d33b71907191f654c" id="r_a86fe2b0a7479713d33b71907191f654c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a86fe2b0a7479713d33b71907191f654c">getScale</a> () const</td></tr>
<tr class="memdesc:a86fe2b0a7479713d33b71907191f654c"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the current scale of the object <br /></td></tr>
<tr class="separator:a86fe2b0a7479713d33b71907191f654c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa32ea5e8c64716f07d0939252d8d7e31" id="r_aa32ea5e8c64716f07d0939252d8d7e31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#aa32ea5e8c64716f07d0939252d8d7e31">getOrigin</a> () const</td></tr>
<tr class="memdesc:aa32ea5e8c64716f07d0939252d8d7e31"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the local origin of the object <br /></td></tr>
<tr class="separator:aa32ea5e8c64716f07d0939252d8d7e31"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a860e50085b49a46a71cd028f7f5d8f6d" id="r_a860e50085b49a46a71cd028f7f5d8f6d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a860e50085b49a46a71cd028f7f5d8f6d">move</a> (<a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> offset)</td></tr>
<tr class="memdesc:a860e50085b49a46a71cd028f7f5d8f6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the object by a given offset. <br /></td></tr>
<tr class="separator:a860e50085b49a46a71cd028f7f5d8f6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacd4c9a92b44f5a0cd95e2fe3741f8f1" id="r_aacd4c9a92b44f5a0cd95e2fe3741f8f1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#aacd4c9a92b44f5a0cd95e2fe3741f8f1">rotate</a> (<a class="el" href="classsf_1_1Angle.html">Angle</a> angle)</td></tr>
<tr class="memdesc:aacd4c9a92b44f5a0cd95e2fe3741f8f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotate the object. <br /></td></tr>
<tr class="separator:aacd4c9a92b44f5a0cd95e2fe3741f8f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a24060d4216813d6f39698cf1cc82be98" id="r_a24060d4216813d6f39698cf1cc82be98"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98">scale</a> (<a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> factor)</td></tr>
<tr class="memdesc:a24060d4216813d6f39698cf1cc82be98"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scale the object. <br /></td></tr>
<tr class="separator:a24060d4216813d6f39698cf1cc82be98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e1b4772a451ec66ac7e6af655726154" id="r_a3e1b4772a451ec66ac7e6af655726154"><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_1Transformable.html#a3e1b4772a451ec66ac7e6af655726154">getTransform</a> () const</td></tr>
<tr class="memdesc:a3e1b4772a451ec66ac7e6af655726154"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the combined transform of the object <br /></td></tr>
<tr class="separator:a3e1b4772a451ec66ac7e6af655726154"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5e75d724436069d2268791c6b486916" id="r_ac5e75d724436069d2268791c6b486916"><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_1Transformable.html#ac5e75d724436069d2268791c6b486916">getInverseTransform</a> () const</td></tr>
<tr class="memdesc:ac5e75d724436069d2268791c6b486916"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the inverse of the combined transform of the object <br /></td></tr>
<tr class="separator:ac5e75d724436069d2268791c6b486916"><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><a class="el" href="classsf_1_1Drawable.html" title="Abstract base class for objects that can be drawn to a render target.">Drawable</a> representation of a texture, with its own transformations, color, etc. </p>
<p><code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> is a drawable class that allows to easily display a texture (or a part of it) on a render target.</p>
<p>It inherits all the functions from <code><a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale.">sf::Transformable</a></code>: position, rotation, scale, origin. It also adds sprite-specific properties such as the texture to use, the part of it to display, and some convenience functions to change the overall color of the sprite, or to get its bounding rectangle.</p>
<p><code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> works in combination with the <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> class, which loads and provides the pixel data of a given texture.</p>
<p>The separation of <code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> and <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> allows more flexibility and better performances: indeed a <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> is a heavy resource, and any operation on it is slow (often too slow for real-time applications). On the other side, a <code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> is a lightweight object which can use the pixel data of a <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> and draw it with its own transformation/color/blending attributes.</p>
<p>It is important to note that the <code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> instance doesn't copy the texture that it uses, it only keeps a reference to it. Thus, a <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> must not be destroyed while it is used by a <code><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc.">sf::Sprite</a></code> (i.e. never write a function that uses a local <code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code> instance for creating a sprite).</p>
<p>See also the note on coordinates and undistorted rendering in <code><a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale.">sf::Transformable</a></code>.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// Load a texture</span></div>
<div class="line"><span class="keyword">const</span> <a class="code hl_class" href="classsf_1_1Texture.html">sf::Texture</a> texture(<span class="stringliteral">&quot;texture.png&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create a sprite</span></div>
<div class="line"><a class="code hl_class" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite(texture);</div>
<div class="line">sprite.setTextureRect({{10, 10}, {50, 30}});</div>
<div class="line">sprite.setColor({255, 255, 255, 200});</div>
<div class="line">sprite.setPosition({100.f, 25.f});</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Draw it</span></div>
<div class="line">window.draw(sprite);</div>
<div class="ttc" id="aclasssf_1_1Sprite_html"><div class="ttname"><a href="classsf_1_1Sprite.html">sf::Sprite</a></div><div class="ttdoc">Drawable representation of a texture, with its own transformations, color, etc.</div><div class="ttdef"><b>Definition</b> <a href="Sprite_8hpp_source.html#l00050">Sprite.hpp:51</a></div></div>
<div class="ttc" id="aclasssf_1_1Texture_html"><div class="ttname"><a href="classsf_1_1Texture.html">sf::Texture</a></div><div class="ttdoc">Image living on the graphics card that can be used for drawing.</div><div class="ttdef"><b>Definition</b> <a href="Texture_8hpp_source.html#l00055">Texture.hpp:56</a></div></div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">sf::Texture</a></code>, <code><a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale.">sf::Transformable</a></code> </dd></dl>
<p class="definition">Definition at line <a class="el" href="Sprite_8hpp_source.html#l00050">50</a> of file <a class="el" href="Sprite_8hpp_source.html">Sprite.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a2a9fca374d7abf084bb1c143a879ff4a" name="a2a9fca374d7abf084bb1c143a879ff4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2a9fca374d7abf084bb1c143a879ff4a">&#9670;&#160;</a></span>Sprite() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">sf::Sprite::Sprite </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span></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 sprite from a source texture. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">texture</td><td>Source texture</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite.">setTexture</a></code> </dd></dl>
</div>
</div>
<a id="a435bce19c80d0e81e5b421497e6bc6b9" name="a435bce19c80d0e81e5b421497e6bc6b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a435bce19c80d0e81e5b421497e6bc6b9">&#9670;&#160;</a></span>Sprite() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">sf::Sprite::Sprite </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span><span class="mlabel">delete</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Disallow construction from a temporary texture. </p>
</div>
</div>
<a id="a01cfe1402372d243dbaa2ffa96020206" name="a01cfe1402372d243dbaa2ffa96020206"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01cfe1402372d243dbaa2ffa96020206">&#9670;&#160;</a></span>Sprite() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Sprite::Sprite </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;</td> <td class="paramname"><span class="paramname"><em>rectangle</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct the sprite from a sub-rectangle of a source texture. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">texture</td><td>Source texture </td></tr>
<tr><td class="paramname">rectangle</td><td>Sub-rectangle of the texture to assign to the sprite</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite.">setTexture</a></code>, <code><a class="el" href="#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display.">setTextureRect</a></code> </dd></dl>
</div>
</div>
<a id="aa8b4b6d5a98e8fa6c09f146c04c0d472" name="aa8b4b6d5a98e8fa6c09f146c04c0d472"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8b4b6d5a98e8fa6c09f146c04c0d472">&#9670;&#160;</a></span>Sprite() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">sf::Sprite::Sprite </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;</td> <td class="paramname"><span class="paramname"><em>rectangle</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">delete</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Disallow construction from a temporary texture. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a54562d0a2d0a65a37829ee58ca02c289" name="a54562d0a2d0a65a37829ee58ca02c289"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54562d0a2d0a65a37829ee58ca02c289">&#9670;&#160;</a></span>getColor()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Color.html">Color</a> sf::Sprite::getColor </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the global color of the sprite. </p>
<dl class="section return"><dt>Returns</dt><dd>Global color of the sprite</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a2ce64c561193c124cd63d5adb1750ad4" title="Set the global color of the sprite.">setColor</a></code> </dd></dl>
</div>
</div>
<a id="aa795483096b90745b2e799532963e271" name="aa795483096b90745b2e799532963e271"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa795483096b90745b2e799532963e271">&#9670;&#160;</a></span>getGlobalBounds()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacesf.html#a701020eb396e62ba560619e68c689a38">FloatRect</a> sf::Sprite::getGlobalBounds </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the global bounding rectangle of the entity. </p>
<p>The returned rectangle is in global coordinates, which means that it takes into account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.</p>
<dl class="section return"><dt>Returns</dt><dd>Global bounding rectangle of the entity </dd></dl>
</div>
</div>
<a id="ac5e75d724436069d2268791c6b486916" name="ac5e75d724436069d2268791c6b486916"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5e75d724436069d2268791c6b486916">&#9670;&#160;</a></span>getInverseTransform()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp; sf::Transformable::getInverseTransform </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the inverse of the combined transform of the object </p>
<dl class="section return"><dt>Returns</dt><dd>Inverse of the combined transformations applied to the object</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a3e1b4772a451ec66ac7e6af655726154" title="get the combined transform of the object">getTransform</a></code> </dd></dl>
</div>
</div>
<a id="ab2f4c781464da6f8a52b1df6058a48b8" name="ab2f4c781464da6f8a52b1df6058a48b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2f4c781464da6f8a52b1df6058a48b8">&#9670;&#160;</a></span>getLocalBounds()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacesf.html#a701020eb396e62ba560619e68c689a38">FloatRect</a> sf::Sprite::getLocalBounds </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the local bounding rectangle of the entity. </p>
<p>The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.</p>
<dl class="section return"><dt>Returns</dt><dd>Local bounding rectangle of the entity </dd></dl>
</div>
</div>
<a id="aa32ea5e8c64716f07d0939252d8d7e31" name="aa32ea5e8c64716f07d0939252d8d7e31"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa32ea5e8c64716f07d0939252d8d7e31">&#9670;&#160;</a></span>getOrigin()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> sf::Transformable::getOrigin </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the local origin of the object </p>
<dl class="section return"><dt>Returns</dt><dd>Current origin</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a26788f72ade7ffadb8ba594c3332c4a8" title="set the local origin of the object">setOrigin</a></code> </dd></dl>
</div>
</div>
<a id="a88a224d0831261591beace74cd3ad67b" name="a88a224d0831261591beace74cd3ad67b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88a224d0831261591beace74cd3ad67b">&#9670;&#160;</a></span>getPosition()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> sf::Transformable::getPosition </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the position of the object </p>
<dl class="section return"><dt>Returns</dt><dd>Current position</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a47c1375b57cbb0e513286e8d11f6dd4d" title="set the position of the object">setPosition</a></code> </dd></dl>
</div>
</div>
<a id="a11ca740731d6c2cdde3cc8ae3bda3785" name="a11ca740731d6c2cdde3cc8ae3bda3785"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11ca740731d6c2cdde3cc8ae3bda3785">&#9670;&#160;</a></span>getRotation()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Angle.html">Angle</a> sf::Transformable::getRotation </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the orientation of the object </p>
<p>The rotation is always in the range [0, 360].</p>
<dl class="section return"><dt>Returns</dt><dd>Current rotation</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a1b4bfa83da965c03ef523c7c33df991f" title="set the orientation of the object">setRotation</a></code> </dd></dl>
</div>
</div>
<a id="a86fe2b0a7479713d33b71907191f654c" name="a86fe2b0a7479713d33b71907191f654c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a86fe2b0a7479713d33b71907191f654c">&#9670;&#160;</a></span>getScale()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a> sf::Transformable::getScale </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the current scale of the object </p>
<dl class="section return"><dt>Returns</dt><dd>Current scale factors</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a60b82c58502e86f258c9844a1a58400b" title="set the scale factors of the object">setScale</a></code> </dd></dl>
</div>
</div>
<a id="a1fa65388fd2751a8d4ca93722dabdd96" name="a1fa65388fd2751a8d4ca93722dabdd96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fa65388fd2751a8d4ca93722dabdd96">&#9670;&#160;</a></span>getTexture()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp; sf::Sprite::getTexture </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the source texture of the sprite. </p>
<p>The returned reference is const, which means that you can't modify the texture when you retrieve it with this function.</p>
<dl class="section return"><dt>Returns</dt><dd>Reference to the sprite's texture</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite.">setTexture</a></code> </dd></dl>
</div>
</div>
<a id="afb19e5b4f39d17cf4d95752b3a79bcb6" name="afb19e5b4f39d17cf4d95752b3a79bcb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb19e5b4f39d17cf4d95752b3a79bcb6">&#9670;&#160;</a></span>getTextureRect()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp; sf::Sprite::getTextureRect </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the sub-rectangle of the texture displayed by the sprite. </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing.">Texture</a> rectangle of the sprite</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display.">setTextureRect</a></code> </dd></dl>
</div>
</div>
<a id="a3e1b4772a451ec66ac7e6af655726154" name="a3e1b4772a451ec66ac7e6af655726154"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e1b4772a451ec66ac7e6af655726154">&#9670;&#160;</a></span>getTransform()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp; sf::Transformable::getTransform </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">nodiscard</span><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>get the combined transform of the object </p>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classsf_1_1Transform.html" title="3x3 transform matrix">Transform</a> combining the position/rotation/scale/origin of the object</dd></dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#ac5e75d724436069d2268791c6b486916" title="get the inverse of the combined transform of the object">getInverseTransform</a></code> </dd></dl>
</div>
</div>
<a id="a860e50085b49a46a71cd028f7f5d8f6d" name="a860e50085b49a46a71cd028f7f5d8f6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a860e50085b49a46a71cd028f7f5d8f6d">&#9670;&#160;</a></span>move()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::move </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a></td> <td class="paramname"><span class="paramname"><em>offset</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Move the object by a given offset. </p>
<p>This function adds to the current position of the object, unlike <code>setPosition</code> which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><span class="keywordtype">object</span>.setPosition(<span class="keywordtype">object</span>.<a class="code hl_function" href="classsf_1_1Transformable.html#a88a224d0831261591beace74cd3ad67b">getPosition</a>() + offset);</div>
<div class="ttc" id="aclasssf_1_1Transformable_html_a88a224d0831261591beace74cd3ad67b"><div class="ttname"><a href="classsf_1_1Transformable.html#a88a224d0831261591beace74cd3ad67b">sf::Transformable::getPosition</a></div><div class="ttdeci">Vector2f getPosition() const</div><div class="ttdoc">get the position of the object</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">offset</td><td>Offset</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a47c1375b57cbb0e513286e8d11f6dd4d" title="set the position of the object">setPosition</a></code> </dd></dl>
</div>
</div>
<a id="aacd4c9a92b44f5a0cd95e2fe3741f8f1" name="aacd4c9a92b44f5a0cd95e2fe3741f8f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aacd4c9a92b44f5a0cd95e2fe3741f8f1">&#9670;&#160;</a></span>rotate()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::rotate </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Angle.html">Angle</a></td> <td class="paramname"><span class="paramname"><em>angle</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Rotate the object. </p>
<p>This function adds to the current rotation of the object, unlike <code>setRotation</code> which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><span class="keywordtype">object</span>.setRotation(<span class="keywordtype">object</span>.<a class="code hl_function" href="classsf_1_1Transformable.html#a11ca740731d6c2cdde3cc8ae3bda3785">getRotation</a>() + angle);</div>
<div class="ttc" id="aclasssf_1_1Transformable_html_a11ca740731d6c2cdde3cc8ae3bda3785"><div class="ttname"><a href="classsf_1_1Transformable.html#a11ca740731d6c2cdde3cc8ae3bda3785">sf::Transformable::getRotation</a></div><div class="ttdeci">Angle getRotation() const</div><div class="ttdoc">get the orientation of the object</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td><a class="el" href="classsf_1_1Angle.html" title="Represents an angle value.">Angle</a> of rotation </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="a24060d4216813d6f39698cf1cc82be98" name="a24060d4216813d6f39698cf1cc82be98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a24060d4216813d6f39698cf1cc82be98">&#9670;&#160;</a></span>scale()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::scale </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a></td> <td class="paramname"><span class="paramname"><em>factor</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Scale the object. </p>
<p>This function multiplies the current scale of the object, unlike <code>setScale</code> which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><a class="code hl_class" href="classsf_1_1Vector2.html">sf::Vector2f</a> <a class="code hl_function" href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98">scale</a> = <span class="keywordtype">object</span>.getScale();</div>
<div class="line"><span class="keywordtype">object</span>.setScale(<a class="code hl_function" href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98">scale</a>.x * factor.x, <a class="code hl_function" href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98">scale</a>.y * factor.y);</div>
<div class="ttc" id="aclasssf_1_1Transformable_html_a24060d4216813d6f39698cf1cc82be98"><div class="ttname"><a href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98">sf::Transformable::scale</a></div><div class="ttdeci">void scale(Vector2f factor)</div><div class="ttdoc">Scale the object.</div></div>
<div class="ttc" id="aclasssf_1_1Vector2_html"><div class="ttname"><a href="classsf_1_1Vector2.html">sf::Vector2&lt; float &gt;</a></div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">factor</td><td>Scale factors</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a60b82c58502e86f258c9844a1a58400b" title="set the scale factors of the object">setScale</a></code> </dd></dl>
</div>
</div>
<a id="a2ce64c561193c124cd63d5adb1750ad4" name="a2ce64c561193c124cd63d5adb1750ad4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2ce64c561193c124cd63d5adb1750ad4">&#9670;&#160;</a></span>setColor()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::Sprite::setColor </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Color.html">Color</a></td> <td class="paramname"><span class="paramname"><em>color</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the global color of the sprite. </p>
<p>This color is modulated (multiplied) with the sprite's texture. It can be used to colorize the sprite, or change its global opacity. By default, the sprite's color is opaque white.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">color</td><td>New color of the sprite</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a54562d0a2d0a65a37829ee58ca02c289" title="Get the global color of the sprite.">getColor</a></code> </dd></dl>
</div>
</div>
<a id="a26788f72ade7ffadb8ba594c3332c4a8" name="a26788f72ade7ffadb8ba594c3332c4a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26788f72ade7ffadb8ba594c3332c4a8">&#9670;&#160;</a></span>setOrigin()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::setOrigin </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a></td> <td class="paramname"><span class="paramname"><em>origin</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>set the local origin of the object </p>
<p>The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a transformable object is (0, 0).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">origin</td><td>New origin</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#aa32ea5e8c64716f07d0939252d8d7e31" title="get the local origin of the object">getOrigin</a></code> </dd></dl>
</div>
</div>
<a id="a47c1375b57cbb0e513286e8d11f6dd4d" name="a47c1375b57cbb0e513286e8d11f6dd4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47c1375b57cbb0e513286e8d11f6dd4d">&#9670;&#160;</a></span>setPosition()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::setPosition </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a></td> <td class="paramname"><span class="paramname"><em>position</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>set the position of the object </p>
<p>This function completely overwrites the previous position. See the move function to apply an offset based on the previous position instead. The default position of a transformable object is (0, 0).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">position</td><td>New position</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a860e50085b49a46a71cd028f7f5d8f6d" title="Move the object by a given offset.">move</a></code>, <code><a class="el" href="classsf_1_1Transformable.html#a88a224d0831261591beace74cd3ad67b" title="get the position of the object">getPosition</a></code> </dd></dl>
</div>
</div>
<a id="a1b4bfa83da965c03ef523c7c33df991f" name="a1b4bfa83da965c03ef523c7c33df991f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b4bfa83da965c03ef523c7c33df991f">&#9670;&#160;</a></span>setRotation()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::setRotation </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Angle.html">Angle</a></td> <td class="paramname"><span class="paramname"><em>angle</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>set the orientation of the object </p>
<p>This function completely overwrites the previous rotation. See the rotate function to add an angle based on the previous rotation instead. The default rotation of a transformable object is 0.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>New rotation</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#aacd4c9a92b44f5a0cd95e2fe3741f8f1" title="Rotate the object.">rotate</a></code>, <code><a class="el" href="classsf_1_1Transformable.html#a11ca740731d6c2cdde3cc8ae3bda3785" title="get the orientation of the object">getRotation</a></code> </dd></dl>
</div>
</div>
<a id="a60b82c58502e86f258c9844a1a58400b" name="a60b82c58502e86f258c9844a1a58400b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60b82c58502e86f258c9844a1a58400b">&#9670;&#160;</a></span>setScale()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Transformable::setScale </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacesf.html#af14b40e82368dd601a7ef8037214804d">Vector2f</a></td> <td class="paramname"><span class="paramname"><em>factors</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inherited</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>set the scale factors of the object </p>
<p>This function completely overwrites the previous scale. See the scale function to add a factor based on the previous scale instead. The default scale of a transformable object is (1, 1).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">factors</td><td>New scale factors</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classsf_1_1Transformable.html#a24060d4216813d6f39698cf1cc82be98" title="Scale the object.">scale</a></code>, <code><a class="el" href="classsf_1_1Transformable.html#a86fe2b0a7479713d33b71907191f654c" title="get the current scale of the object">getScale</a></code> </dd></dl>
</div>
</div>
<a id="a4ae0447240b8ddc93e74ed832c570409" name="a4ae0447240b8ddc93e74ed832c570409"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ae0447240b8ddc93e74ed832c570409">&#9670;&#160;</a></span>setTexture() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void sf::Sprite::setTexture </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;&amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>resetRect</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">delete</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Disallow setting from a temporary texture. </p>
</div>
</div>
<a id="a3729c88d88ac38c19317c18e87242560" name="a3729c88d88ac38c19317c18e87242560"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3729c88d88ac38c19317c18e87242560">&#9670;&#160;</a></span>setTexture() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::Sprite::setTexture </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> &amp;</td> <td class="paramname"><span class="paramname"><em>texture</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>resetRect</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Change the source texture of the sprite. </p>
<p>The <code>texture</code> argument refers to a texture that must exist as long as the sprite uses it. Indeed, the sprite doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the sprite tries to use it, the behavior is undefined. If <code>resetRect</code> is <code>true</code>, the <code>TextureRect</code> property of the sprite is automatically adjusted to the size of the new texture. If it is <code>false</code>, the texture rect is left unchanged.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">texture</td><td>New texture </td></tr>
<tr><td class="paramname">resetRect</td><td>Should the texture rect be reset to the size of the new texture?</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#a1fa65388fd2751a8d4ca93722dabdd96" title="Get the source texture of the sprite.">getTexture</a></code>, <code><a class="el" href="#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display.">setTextureRect</a></code> </dd></dl>
</div>
</div>
<a id="a3fefec419a4e6a90c0fd54c793d82ec2" name="a3fefec419a4e6a90c0fd54c793d82ec2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3fefec419a4e6a90c0fd54c793d82ec2">&#9670;&#160;</a></span>setTextureRect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sf::Sprite::setTextureRect </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="namespacesf.html#add1cf75a734c8414680b0424145c30b1">IntRect</a> &amp;</td> <td class="paramname"><span class="paramname"><em>rectangle</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the sub-rectangle of the texture that the sprite will display. </p>
<p>The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rectangle</td><td>Rectangle defining the region of the texture to display</td></tr>
</table>
</dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="#afb19e5b4f39d17cf4d95752b3a79bcb6" title="Get the sub-rectangle of the texture displayed by the sprite.">getTextureRect</a></code>, <code><a class="el" href="#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite.">setTexture</a></code> </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Sprite_8hpp_source.html">Sprite.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>