1134 lines
68 KiB
HTML
1134 lines
68 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 Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related 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 List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Sprite.html">Sprite</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<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="classsf_1_1Sprite.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Sprite_8hpp_source.html">Sprite.hpp</a>></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 name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a92559fbca895a96758abf5eabab96984"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a92559fbca895a96758abf5eabab96984">Sprite</a> ()</td></tr>
|
|
<tr class="memdesc:a92559fbca895a96758abf5eabab96984"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a92559fbca895a96758abf5eabab96984">More...</a><br /></td></tr>
|
|
<tr class="separator:a92559fbca895a96758abf5eabab96984"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2a9fca374d7abf084bb1c143a879ff4a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a2a9fca374d7abf084bb1c143a879ff4a">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &texture)</td></tr>
|
|
<tr class="memdesc:a2a9fca374d7abf084bb1c143a879ff4a"><td class="mdescLeft"> </td><td class="mdescRight">Construct the sprite from a source texture. <a href="#a2a9fca374d7abf084bb1c143a879ff4a">More...</a><br /></td></tr>
|
|
<tr class="separator:a2a9fca374d7abf084bb1c143a879ff4a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a01cfe1402372d243dbaa2ffa96020206"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a01cfe1402372d243dbaa2ffa96020206">Sprite</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &texture, const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &rectangle)</td></tr>
|
|
<tr class="memdesc:a01cfe1402372d243dbaa2ffa96020206"><td class="mdescLeft"> </td><td class="mdescRight">Construct the sprite from a sub-rectangle of a source texture. <a href="#a01cfe1402372d243dbaa2ffa96020206">More...</a><br /></td></tr>
|
|
<tr class="separator:a01cfe1402372d243dbaa2ffa96020206"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3729c88d88ac38c19317c18e87242560"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560">setTexture</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> &texture, bool resetRect=false)</td></tr>
|
|
<tr class="memdesc:a3729c88d88ac38c19317c18e87242560"><td class="mdescLeft"> </td><td class="mdescRight">Change the source texture of the sprite. <a href="#a3729c88d88ac38c19317c18e87242560">More...</a><br /></td></tr>
|
|
<tr class="separator:a3729c88d88ac38c19317c18e87242560"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3fefec419a4e6a90c0fd54c793d82ec2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a3fefec419a4e6a90c0fd54c793d82ec2">setTextureRect</a> (const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &rectangle)</td></tr>
|
|
<tr class="memdesc:a3fefec419a4e6a90c0fd54c793d82ec2"><td class="mdescLeft"> </td><td class="mdescRight">Set the sub-rectangle of the texture that the sprite will display. <a href="#a3fefec419a4e6a90c0fd54c793d82ec2">More...</a><br /></td></tr>
|
|
<tr class="separator:a3fefec419a4e6a90c0fd54c793d82ec2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a14def44da6437bfea20c4df5e71aba4c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a14def44da6437bfea20c4df5e71aba4c">setColor</a> (const <a class="el" href="classsf_1_1Color.html">Color</a> &color)</td></tr>
|
|
<tr class="memdesc:a14def44da6437bfea20c4df5e71aba4c"><td class="mdescLeft"> </td><td class="mdescRight">Set the global color of the sprite. <a href="#a14def44da6437bfea20c4df5e71aba4c">More...</a><br /></td></tr>
|
|
<tr class="separator:a14def44da6437bfea20c4df5e71aba4c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1a76155146c8ff37c4eb5a306b4e9ebe"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Texture.html">Texture</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a1a76155146c8ff37c4eb5a306b4e9ebe">getTexture</a> () const</td></tr>
|
|
<tr class="memdesc:a1a76155146c8ff37c4eb5a306b4e9ebe"><td class="mdescLeft"> </td><td class="mdescRight">Get the source texture of the sprite. <a href="#a1a76155146c8ff37c4eb5a306b4e9ebe">More...</a><br /></td></tr>
|
|
<tr class="separator:a1a76155146c8ff37c4eb5a306b4e9ebe"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3492896fe7b63f58ae022c5b8bec5c98"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#a3492896fe7b63f58ae022c5b8bec5c98">getTextureRect</a> () const</td></tr>
|
|
<tr class="memdesc:a3492896fe7b63f58ae022c5b8bec5c98"><td class="mdescLeft"> </td><td class="mdescRight">Get the sub-rectangle of the texture displayed by the sprite. <a href="#a3492896fe7b63f58ae022c5b8bec5c98">More...</a><br /></td></tr>
|
|
<tr class="separator:a3492896fe7b63f58ae022c5b8bec5c98"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac5f419f37b4e38f7a94186e3a3e303e1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Color.html">Color</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#ac5f419f37b4e38f7a94186e3a3e303e1">getColor</a> () const</td></tr>
|
|
<tr class="memdesc:ac5f419f37b4e38f7a94186e3a3e303e1"><td class="mdescLeft"> </td><td class="mdescRight">Get the global color of the sprite. <a href="#ac5f419f37b4e38f7a94186e3a3e303e1">More...</a><br /></td></tr>
|
|
<tr class="separator:ac5f419f37b4e38f7a94186e3a3e303e1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab2f4c781464da6f8a52b1df6058a48b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Rect.html">FloatRect</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#ab2f4c781464da6f8a52b1df6058a48b8">getLocalBounds</a> () const</td></tr>
|
|
<tr class="memdesc:ab2f4c781464da6f8a52b1df6058a48b8"><td class="mdescLeft"> </td><td class="mdescRight">Get the local bounding rectangle of the entity. <a href="#ab2f4c781464da6f8a52b1df6058a48b8">More...</a><br /></td></tr>
|
|
<tr class="separator:ab2f4c781464da6f8a52b1df6058a48b8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa795483096b90745b2e799532963e271"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Rect.html">FloatRect</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Sprite.html#aa795483096b90745b2e799532963e271">getGlobalBounds</a> () const</td></tr>
|
|
<tr class="memdesc:aa795483096b90745b2e799532963e271"><td class="mdescLeft"> </td><td class="mdescRight">Get the global bounding rectangle of the entity. <a href="#aa795483096b90745b2e799532963e271">More...</a><br /></td></tr>
|
|
<tr class="separator:aa795483096b90745b2e799532963e271"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4dbfb1a7c80688b0b4c477d706550208"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a4dbfb1a7c80688b0b4c477d706550208">setPosition</a> (float x, float y)</td></tr>
|
|
<tr class="memdesc:a4dbfb1a7c80688b0b4c477d706550208"><td class="mdescLeft"> </td><td class="mdescRight">set the position of the object <a href="#a4dbfb1a7c80688b0b4c477d706550208">More...</a><br /></td></tr>
|
|
<tr class="separator:a4dbfb1a7c80688b0b4c477d706550208"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af1a42209ce2b5d3f07b00f917bcd8015"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#af1a42209ce2b5d3f07b00f917bcd8015">setPosition</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &position)</td></tr>
|
|
<tr class="memdesc:af1a42209ce2b5d3f07b00f917bcd8015"><td class="mdescLeft"> </td><td class="mdescRight">set the position of the object <a href="#af1a42209ce2b5d3f07b00f917bcd8015">More...</a><br /></td></tr>
|
|
<tr class="separator:af1a42209ce2b5d3f07b00f917bcd8015"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a32baf2bf1a74699b03bf8c95030a38ed"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a32baf2bf1a74699b03bf8c95030a38ed">setRotation</a> (float angle)</td></tr>
|
|
<tr class="memdesc:a32baf2bf1a74699b03bf8c95030a38ed"><td class="mdescLeft"> </td><td class="mdescRight">set the orientation of the object <a href="#a32baf2bf1a74699b03bf8c95030a38ed">More...</a><br /></td></tr>
|
|
<tr class="separator:a32baf2bf1a74699b03bf8c95030a38ed"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aaec50b46b3f41b054763304d1e727471"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#aaec50b46b3f41b054763304d1e727471">setScale</a> (float factorX, float factorY)</td></tr>
|
|
<tr class="memdesc:aaec50b46b3f41b054763304d1e727471"><td class="mdescLeft"> </td><td class="mdescRight">set the scale factors of the object <a href="#aaec50b46b3f41b054763304d1e727471">More...</a><br /></td></tr>
|
|
<tr class="separator:aaec50b46b3f41b054763304d1e727471"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4c48a87f1626047e448f9c1a68ff167e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a4c48a87f1626047e448f9c1a68ff167e">setScale</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &factors)</td></tr>
|
|
<tr class="memdesc:a4c48a87f1626047e448f9c1a68ff167e"><td class="mdescLeft"> </td><td class="mdescRight">set the scale factors of the object <a href="#a4c48a87f1626047e448f9c1a68ff167e">More...</a><br /></td></tr>
|
|
<tr class="separator:a4c48a87f1626047e448f9c1a68ff167e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a56c67bd80aae8418d13fb96c034d25ec"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a56c67bd80aae8418d13fb96c034d25ec">setOrigin</a> (float x, float y)</td></tr>
|
|
<tr class="memdesc:a56c67bd80aae8418d13fb96c034d25ec"><td class="mdescLeft"> </td><td class="mdescRight">set the local origin of the object <a href="#a56c67bd80aae8418d13fb96c034d25ec">More...</a><br /></td></tr>
|
|
<tr class="separator:a56c67bd80aae8418d13fb96c034d25ec"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa93a835ffbf3bee2098dfbbc695a7f05"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#aa93a835ffbf3bee2098dfbbc695a7f05">setOrigin</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &origin)</td></tr>
|
|
<tr class="memdesc:aa93a835ffbf3bee2098dfbbc695a7f05"><td class="mdescLeft"> </td><td class="mdescRight">set the local origin of the object <a href="#aa93a835ffbf3bee2098dfbbc695a7f05">More...</a><br /></td></tr>
|
|
<tr class="separator:aa93a835ffbf3bee2098dfbbc695a7f05"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a73f9739bc6e74db2cea154bc8e94ec46"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a73f9739bc6e74db2cea154bc8e94ec46">getPosition</a> () const</td></tr>
|
|
<tr class="memdesc:a73f9739bc6e74db2cea154bc8e94ec46"><td class="mdescLeft"> </td><td class="mdescRight">get the position of the object <a href="#a73f9739bc6e74db2cea154bc8e94ec46">More...</a><br /></td></tr>
|
|
<tr class="separator:a73f9739bc6e74db2cea154bc8e94ec46"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa00b5c5d4a06ac24a94dd72c56931d3a"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#aa00b5c5d4a06ac24a94dd72c56931d3a">getRotation</a> () const</td></tr>
|
|
<tr class="memdesc:aa00b5c5d4a06ac24a94dd72c56931d3a"><td class="mdescLeft"> </td><td class="mdescRight">get the orientation of the object <a href="#aa00b5c5d4a06ac24a94dd72c56931d3a">More...</a><br /></td></tr>
|
|
<tr class="separator:aa00b5c5d4a06ac24a94dd72c56931d3a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a73819fdea80ca8a06fad8a0067b4588c"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a73819fdea80ca8a06fad8a0067b4588c">getScale</a> () const</td></tr>
|
|
<tr class="memdesc:a73819fdea80ca8a06fad8a0067b4588c"><td class="mdescLeft"> </td><td class="mdescRight">get the current scale of the object <a href="#a73819fdea80ca8a06fad8a0067b4588c">More...</a><br /></td></tr>
|
|
<tr class="separator:a73819fdea80ca8a06fad8a0067b4588c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a37ea3500afac234814a43ce809ef264e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a37ea3500afac234814a43ce809ef264e">getOrigin</a> () const</td></tr>
|
|
<tr class="memdesc:a37ea3500afac234814a43ce809ef264e"><td class="mdescLeft"> </td><td class="mdescRight">get the local origin of the object <a href="#a37ea3500afac234814a43ce809ef264e">More...</a><br /></td></tr>
|
|
<tr class="separator:a37ea3500afac234814a43ce809ef264e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a86b461d6a941ad390c2ad8b6a4a20391"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a86b461d6a941ad390c2ad8b6a4a20391">move</a> (float offsetX, float offsetY)</td></tr>
|
|
<tr class="memdesc:a86b461d6a941ad390c2ad8b6a4a20391"><td class="mdescLeft"> </td><td class="mdescRight">Move the object by a given offset. <a href="#a86b461d6a941ad390c2ad8b6a4a20391">More...</a><br /></td></tr>
|
|
<tr class="separator:a86b461d6a941ad390c2ad8b6a4a20391"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab9ca691522f6ddc1a40406849b87c469"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#ab9ca691522f6ddc1a40406849b87c469">move</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &offset)</td></tr>
|
|
<tr class="memdesc:ab9ca691522f6ddc1a40406849b87c469"><td class="mdescLeft"> </td><td class="mdescRight">Move the object by a given offset. <a href="#ab9ca691522f6ddc1a40406849b87c469">More...</a><br /></td></tr>
|
|
<tr class="separator:ab9ca691522f6ddc1a40406849b87c469"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af8a5ffddc0d93f238fee3bf8efe1ebda"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#af8a5ffddc0d93f238fee3bf8efe1ebda">rotate</a> (float angle)</td></tr>
|
|
<tr class="memdesc:af8a5ffddc0d93f238fee3bf8efe1ebda"><td class="mdescLeft"> </td><td class="mdescRight">Rotate the object. <a href="#af8a5ffddc0d93f238fee3bf8efe1ebda">More...</a><br /></td></tr>
|
|
<tr class="separator:af8a5ffddc0d93f238fee3bf8efe1ebda"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3de0c6d8957f3cf318092f3f60656391"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a> (float factorX, float factorY)</td></tr>
|
|
<tr class="memdesc:a3de0c6d8957f3cf318092f3f60656391"><td class="mdescLeft"> </td><td class="mdescRight">Scale the object. <a href="#a3de0c6d8957f3cf318092f3f60656391">More...</a><br /></td></tr>
|
|
<tr class="separator:a3de0c6d8957f3cf318092f3f60656391"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adecaa6c69b1f27dd5194b067d96bb694"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#adecaa6c69b1f27dd5194b067d96bb694">scale</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &factor)</td></tr>
|
|
<tr class="memdesc:adecaa6c69b1f27dd5194b067d96bb694"><td class="mdescLeft"> </td><td class="mdescRight">Scale the object. <a href="#adecaa6c69b1f27dd5194b067d96bb694">More...</a><br /></td></tr>
|
|
<tr class="separator:adecaa6c69b1f27dd5194b067d96bb694"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7f7c3f0bab3f162b13613904fbdbb9ad"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.html">Transform</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#a7f7c3f0bab3f162b13613904fbdbb9ad">getTransform</a> () const</td></tr>
|
|
<tr class="memdesc:a7f7c3f0bab3f162b13613904fbdbb9ad"><td class="mdescLeft"> </td><td class="mdescRight">get the combined transform of the object <a href="#a7f7c3f0bab3f162b13613904fbdbb9ad">More...</a><br /></td></tr>
|
|
<tr class="separator:a7f7c3f0bab3f162b13613904fbdbb9ad"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab18b25f51263252ff3811465eb7e9fb1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classsf_1_1Transform.html">Transform</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transformable.html#ab18b25f51263252ff3811465eb7e9fb1">getInverseTransform</a> () const</td></tr>
|
|
<tr class="memdesc:ab18b25f51263252ff3811465eb7e9fb1"><td class="mdescLeft"> </td><td class="mdescRight">get the inverse of the combined transform of the object <a href="#ab18b25f51263252ff3811465eb7e9fb1">More...</a><br /></td></tr>
|
|
<tr class="separator:ab18b25f51263252ff3811465eb7e9fb1"><td class="memSeparator" colspan="2"> </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><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> 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 <a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale. ">sf::Transformable</a>: 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><a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> works in combination with the <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> class, which loads and provides the pixel data of a given texture.</p>
|
|
<p>The separation of <a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> and <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> allows more flexibility and better performances: indeed a <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> is a heavy resource, and any operation on it is slow (often too slow for real-time applications). On the other side, a <a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> is a lightweight object which can use the pixel data of a <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> and draw it with its own transformation/color/blending attributes.</p>
|
|
<p>It is important to note that the <a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> instance doesn't copy the texture that it uses, it only keeps a reference to it. Thus, a <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> must not be destroyed while it is used by a <a class="el" href="classsf_1_1Sprite.html" title="Drawable representation of a texture, with its own transformations, color, etc. ">sf::Sprite</a> (i.e. never write a function that uses a local <a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a> instance for creating a sprite).</p>
|
|
<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>
|
|
<p>Usage example: </p><div class="fragment"><div class="line"><span class="comment">// Declare and load a texture</span></div><div class="line"><a class="code" href="classsf_1_1Texture.html">sf::Texture</a> texture;</div><div class="line">texture.<a class="code" href="classsf_1_1Texture.html#a8e1b56eabfe33e2e0e1cb03712c7fcc7">loadFromFile</a>(<span class="stringliteral">"texture.png"</span>);</div><div class="line"></div><div class="line"><span class="comment">// Create a sprite</span></div><div class="line"><a class="code" href="classsf_1_1Sprite.html">sf::Sprite</a> sprite;</div><div class="line">sprite.<a class="code" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560">setTexture</a>(texture);</div><div class="line">sprite.<a class="code" href="classsf_1_1Sprite.html#a3fefec419a4e6a90c0fd54c793d82ec2">setTextureRect</a>(<a class="code" href="classsf_1_1Rect.html">sf::IntRect</a>(10, 10, 50, 30));</div><div class="line">sprite.<a class="code" href="classsf_1_1Sprite.html#a14def44da6437bfea20c4df5e71aba4c">setColor</a>(<a class="code" href="classsf_1_1Color.html">sf::Color</a>(255, 255, 255, 200));</div><div class="line">sprite.<a class="code" href="classsf_1_1Transformable.html#a4dbfb1a7c80688b0b4c477d706550208">setPosition</a>(100, 25);</div><div class="line"></div><div class="line"><span class="comment">// Draw it</span></div><div class="line">window.draw(sprite);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Texture.html" title="Image living on the graphics card that can be used for drawing. ">sf::Texture</a>, <a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale. ">sf::Transformable</a> </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Sprite_8hpp_source.html#l00047">47</a> of file <a class="el" href="Sprite_8hpp_source.html">Sprite.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a92559fbca895a96758abf5eabab96984"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a92559fbca895a96758abf5eabab96984">◆ </a></span>Sprite() <span class="overload">[1/3]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Sprite::Sprite </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Default constructor. </p>
|
|
<p>Creates an empty sprite with no source texture. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2a9fca374d7abf084bb1c143a879ff4a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2a9fca374d7abf084bb1c143a879ff4a">◆ </a></span>Sprite() <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::Sprite::Sprite </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Texture.html">Texture</a> & </td>
|
|
<td class="paramname"><em>texture</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 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><a class="el" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite. ">setTexture</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a01cfe1402372d243dbaa2ffa96020206"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a01cfe1402372d243dbaa2ffa96020206">◆ </a></span>Sprite() <span class="overload">[3/3]</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> & </td>
|
|
<td class="paramname"><em>texture</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
|
<td class="paramname"><em>rectangle</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></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><a class="el" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite. ">setTexture</a>, <a class="el" href="classsf_1_1Sprite.html#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display. ">setTextureRect</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ac5f419f37b4e38f7a94186e3a3e303e1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac5f419f37b4e38f7a94186e3a3e303e1">◆ </a></span>getColor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="classsf_1_1Color.html">Color</a>& sf::Sprite::getColor </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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><a class="el" href="classsf_1_1Sprite.html#a14def44da6437bfea20c4df5e71aba4c" title="Set the global color of the sprite. ">setColor</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa795483096b90745b2e799532963e271"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa795483096b90745b2e799532963e271">◆ </a></span>getGlobalBounds()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classsf_1_1Rect.html">FloatRect</a> sf::Sprite::getGlobalBounds </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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="ab18b25f51263252ff3811465eb7e9fb1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab18b25f51263252ff3811465eb7e9fb1">◆ </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>& sf::Transformable::getInverseTransform </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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><a class="el" href="classsf_1_1Transformable.html#a7f7c3f0bab3f162b13613904fbdbb9ad" title="get the combined transform of the object ">getTransform</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab2f4c781464da6f8a52b1df6058a48b8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab2f4c781464da6f8a52b1df6058a48b8">◆ </a></span>getLocalBounds()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classsf_1_1Rect.html">FloatRect</a> sf::Sprite::getLocalBounds </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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="a37ea3500afac234814a43ce809ef264e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a37ea3500afac234814a43ce809ef264e">◆ </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">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a>& sf::Transformable::getOrigin </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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><a class="el" href="classsf_1_1Transformable.html#a56c67bd80aae8418d13fb96c034d25ec" title="set the local origin of the object ">setOrigin</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a73f9739bc6e74db2cea154bc8e94ec46"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a73f9739bc6e74db2cea154bc8e94ec46">◆ </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">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a>& sf::Transformable::getPosition </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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><a class="el" href="classsf_1_1Transformable.html#a4dbfb1a7c80688b0b4c477d706550208" title="set the position of the object ">setPosition</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa00b5c5d4a06ac24a94dd72c56931d3a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa00b5c5d4a06ac24a94dd72c56931d3a">◆ </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">float sf::Transformable::getRotation </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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, in degrees</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#a32baf2bf1a74699b03bf8c95030a38ed" title="set the orientation of the object ">setRotation</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a73819fdea80ca8a06fad8a0067b4588c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a73819fdea80ca8a06fad8a0067b4588c">◆ </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">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a>& sf::Transformable::getScale </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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><a class="el" href="classsf_1_1Transformable.html#aaec50b46b3f41b054763304d1e727471" title="set the scale factors of the object ">setScale</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1a76155146c8ff37c4eb5a306b4e9ebe"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1a76155146c8ff37c4eb5a306b4e9ebe">◆ </a></span>getTexture()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="classsf_1_1Texture.html">Texture</a>* sf::Sprite::getTexture </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the source texture of the sprite. </p>
|
|
<p>If the sprite has no source texture, a NULL pointer is returned. The returned pointer 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>Pointer to the sprite's texture</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite. ">setTexture</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3492896fe7b63f58ae022c5b8bec5c98"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3492896fe7b63f58ae022c5b8bec5c98">◆ </a></span>getTextureRect()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const <a class="el" href="classsf_1_1Rect.html">IntRect</a>& sf::Sprite::getTextureRect </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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><a class="el" href="classsf_1_1Sprite.html#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display. ">setTextureRect</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7f7c3f0bab3f162b13613904fbdbb9ad"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7f7c3f0bab3f162b13613904fbdbb9ad">◆ </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>& sf::Transformable::getTransform </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</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>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="Define a 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><a class="el" href="classsf_1_1Transformable.html#ab18b25f51263252ff3811465eb7e9fb1" title="get the inverse of the combined transform of the object ">getInverseTransform</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a86b461d6a941ad390c2ad8b6a4a20391"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a86b461d6a941ad390c2ad8b6a4a20391">◆ </a></span>move() <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::Transformable::move </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>offsetX</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>offsetY</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</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 setPosition which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a> pos = <span class="keywordtype">object</span>.getPosition();</div><div class="line"><span class="keywordtype">object</span>.setPosition(pos.<a class="code" href="classsf_1_1Vector2.html#a1e6ad77fa155f3753bfb92699bd28141">x</a> + offsetX, pos.<a class="code" href="classsf_1_1Vector2.html#a420f2481b015f4eb929c75f2af564299">y</a> + offsetY);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">offsetX</td><td>X offset </td></tr>
|
|
<tr><td class="paramname">offsetY</td><td>Y offset</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#a4dbfb1a7c80688b0b4c477d706550208" title="set the position of the object ">setPosition</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab9ca691522f6ddc1a40406849b87c469"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab9ca691522f6ddc1a40406849b87c469">◆ </a></span>move() <span class="overload">[2/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::Transformable::move </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td>
|
|
<td class="paramname"><em>offset</em></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 setPosition 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" href="classsf_1_1Transformable.html#a73f9739bc6e74db2cea154bc8e94ec46">getPosition</a>() + offset);</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><a class="el" href="classsf_1_1Transformable.html#a4dbfb1a7c80688b0b4c477d706550208" title="set the position of the object ">setPosition</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af8a5ffddc0d93f238fee3bf8efe1ebda"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af8a5ffddc0d93f238fee3bf8efe1ebda">◆ </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">float </td>
|
|
<td class="paramname"><em>angle</em></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 setRotation 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" href="classsf_1_1Transformable.html#aa00b5c5d4a06ac24a94dd72c56931d3a">getRotation</a>() + angle);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">angle</td><td>Angle of rotation, in degrees </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3de0c6d8957f3cf318092f3f60656391"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3de0c6d8957f3cf318092f3f60656391">◆ </a></span>scale() <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::Transformable::scale </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>factorX</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>factorY</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</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 setScale which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a> <a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a> = <span class="keywordtype">object</span>.getScale();</div><div class="line"><span class="keywordtype">object</span>.setScale(<a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a>.x * factorX, <a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a>.y * factorY);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">factorX</td><td>Horizontal scale factor </td></tr>
|
|
<tr><td class="paramname">factorY</td><td>Vertical scale factor</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#aaec50b46b3f41b054763304d1e727471" title="set the scale factors of the object ">setScale</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="adecaa6c69b1f27dd5194b067d96bb694"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#adecaa6c69b1f27dd5194b067d96bb694">◆ </a></span>scale() <span class="overload">[2/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::Transformable::scale </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td>
|
|
<td class="paramname"><em>factor</em></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 setScale which overwrites it. Thus, it is equivalent to the following code: </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a> <a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a> = <span class="keywordtype">object</span>.getScale();</div><div class="line"><span class="keywordtype">object</span>.setScale(<a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a>.x * factor.x, <a class="code" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391">scale</a>.y * factor.y);</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><a class="el" href="classsf_1_1Transformable.html#aaec50b46b3f41b054763304d1e727471" title="set the scale factors of the object ">setScale</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a14def44da6437bfea20c4df5e71aba4c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a14def44da6437bfea20c4df5e71aba4c">◆ </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">const <a class="el" href="classsf_1_1Color.html">Color</a> & </td>
|
|
<td class="paramname"><em>color</em></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><a class="el" href="classsf_1_1Sprite.html#ac5f419f37b4e38f7a94186e3a3e303e1" title="Get the global color of the sprite. ">getColor</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a56c67bd80aae8418d13fb96c034d25ec"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a56c67bd80aae8418d13fb96c034d25ec">◆ </a></span>setOrigin() <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::Transformable::setOrigin </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>x</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>y</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</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">x</td><td>X coordinate of the new origin </td></tr>
|
|
<tr><td class="paramname">y</td><td>Y coordinate of the new origin</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#a37ea3500afac234814a43ce809ef264e" title="get the local origin of the object ">getOrigin</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa93a835ffbf3bee2098dfbbc695a7f05"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa93a835ffbf3bee2098dfbbc695a7f05">◆ </a></span>setOrigin() <span class="overload">[2/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::Transformable::setOrigin </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td>
|
|
<td class="paramname"><em>origin</em></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><a class="el" href="classsf_1_1Transformable.html#a37ea3500afac234814a43ce809ef264e" title="get the local origin of the object ">getOrigin</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4dbfb1a7c80688b0b4c477d706550208"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4dbfb1a7c80688b0b4c477d706550208">◆ </a></span>setPosition() <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::Transformable::setPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>x</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>y</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</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">x</td><td>X coordinate of the new position </td></tr>
|
|
<tr><td class="paramname">y</td><td>Y coordinate of the new position</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#a86b461d6a941ad390c2ad8b6a4a20391" title="Move the object by a given offset. ">move</a>, <a class="el" href="classsf_1_1Transformable.html#a73f9739bc6e74db2cea154bc8e94ec46" title="get the position of the object ">getPosition</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af1a42209ce2b5d3f07b00f917bcd8015"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af1a42209ce2b5d3f07b00f917bcd8015">◆ </a></span>setPosition() <span class="overload">[2/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::Transformable::setPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td>
|
|
<td class="paramname"><em>position</em></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><a class="el" href="classsf_1_1Transformable.html#a86b461d6a941ad390c2ad8b6a4a20391" title="Move the object by a given offset. ">move</a>, <a class="el" href="classsf_1_1Transformable.html#a73f9739bc6e74db2cea154bc8e94ec46" title="get the position of the object ">getPosition</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a32baf2bf1a74699b03bf8c95030a38ed"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a32baf2bf1a74699b03bf8c95030a38ed">◆ </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">float </td>
|
|
<td class="paramname"><em>angle</em></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, in degrees</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#af8a5ffddc0d93f238fee3bf8efe1ebda" title="Rotate the object. ">rotate</a>, <a class="el" href="classsf_1_1Transformable.html#aa00b5c5d4a06ac24a94dd72c56931d3a" title="get the orientation of the object ">getRotation</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaec50b46b3f41b054763304d1e727471"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaec50b46b3f41b054763304d1e727471">◆ </a></span>setScale() <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::Transformable::setScale </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>factorX</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>factorY</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</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">factorX</td><td>New horizontal scale factor </td></tr>
|
|
<tr><td class="paramname">factorY</td><td>New vertical scale factor</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391" title="Scale the object. ">scale</a>, <a class="el" href="classsf_1_1Transformable.html#a73819fdea80ca8a06fad8a0067b4588c" title="get the current scale of the object ">getScale</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4c48a87f1626047e448f9c1a68ff167e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4c48a87f1626047e448f9c1a68ff167e">◆ </a></span>setScale() <span class="overload">[2/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::Transformable::setScale </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> & </td>
|
|
<td class="paramname"><em>factors</em></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><a class="el" href="classsf_1_1Transformable.html#a3de0c6d8957f3cf318092f3f60656391" title="Scale the object. ">scale</a>, <a class="el" href="classsf_1_1Transformable.html#a73819fdea80ca8a06fad8a0067b4588c" title="get the current scale of the object ">getScale</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3729c88d88ac38c19317c18e87242560"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3729c88d88ac38c19317c18e87242560">◆ </a></span>setTexture()</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> & </td>
|
|
<td class="paramname"><em>texture</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>resetRect</em> = <code>false</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Change the source texture of the sprite. </p>
|
|
<p>The <em>texture</em> 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 <em>resetRect</em> is true, the TextureRect property of the sprite is automatically adjusted to the size of the new texture. If it is false, 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><a class="el" href="classsf_1_1Sprite.html#a1a76155146c8ff37c4eb5a306b4e9ebe" title="Get the source texture of the sprite. ">getTexture</a>, <a class="el" href="classsf_1_1Sprite.html#a3fefec419a4e6a90c0fd54c793d82ec2" title="Set the sub-rectangle of the texture that the sprite will display. ">setTextureRect</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3fefec419a4e6a90c0fd54c793d82ec2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3fefec419a4e6a90c0fd54c793d82ec2">◆ </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="classsf_1_1Rect.html">IntRect</a> & </td>
|
|
<td class="paramname"><em>rectangle</em></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><a class="el" href="classsf_1_1Sprite.html#a3492896fe7b63f58ae022c5b8bec5c98" title="Get the sub-rectangle of the texture displayed by the sprite. ">getTextureRect</a>, <a class="el" href="classsf_1_1Sprite.html#a3729c88d88ac38c19317c18e87242560" title="Change the source texture of the sprite. ">setTexture</a> </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 © Laurent Gomila ::
|
|
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|