1329 lines
76 KiB
HTML
1329 lines
76 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_1Shape.html">Shape</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pro-methods">Protected Member Functions</a> |
|
|
<a href="classsf_1_1Shape-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">sf::Shape Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Base class for textured shapes with outline.
|
|
<a href="classsf_1_1Shape.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Shape_8hpp_source.html">Shape.hpp</a>></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for sf::Shape:</div>
|
|
<div class="dyncontent">
|
|
<div class="center">
|
|
<img src="classsf_1_1Shape.png" usemap="#sf::Shape_map" alt=""/>
|
|
<map id="sf::Shape_map" name="sf::Shape_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="65,0,185,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="195,0,315,24"/>
|
|
<area href="classsf_1_1CircleShape.html" title="Specialized shape representing a circle. " alt="sf::CircleShape" shape="rect" coords="0,112,120,136"/>
|
|
<area href="classsf_1_1ConvexShape.html" title="Specialized shape representing a convex polygon. " alt="sf::ConvexShape" shape="rect" coords="130,112,250,136"/>
|
|
<area href="classsf_1_1RectangleShape.html" title="Specialized shape representing a rectangle. " alt="sf::RectangleShape" shape="rect" coords="260,112,380,136"/>
|
|
</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:a2262aceb9df52d4275c19633592f19bf"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a2262aceb9df52d4275c19633592f19bf">~Shape</a> ()</td></tr>
|
|
<tr class="memdesc:a2262aceb9df52d4275c19633592f19bf"><td class="mdescLeft"> </td><td class="mdescRight">Virtual destructor. <a href="#a2262aceb9df52d4275c19633592f19bf">More...</a><br /></td></tr>
|
|
<tr class="separator:a2262aceb9df52d4275c19633592f19bf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af8fb22bab1956325be5d62282711e3b6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#af8fb22bab1956325be5d62282711e3b6">setTexture</a> (const <a class="el" href="classsf_1_1Texture.html">Texture</a> *texture, bool resetRect=false)</td></tr>
|
|
<tr class="memdesc:af8fb22bab1956325be5d62282711e3b6"><td class="mdescLeft"> </td><td class="mdescRight">Change the source texture of the shape. <a href="#af8fb22bab1956325be5d62282711e3b6">More...</a><br /></td></tr>
|
|
<tr class="separator:af8fb22bab1956325be5d62282711e3b6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2029cc820d1740d14ac794b82525e157"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a2029cc820d1740d14ac794b82525e157">setTextureRect</a> (const <a class="el" href="classsf_1_1Rect.html">IntRect</a> &rect)</td></tr>
|
|
<tr class="memdesc:a2029cc820d1740d14ac794b82525e157"><td class="mdescLeft"> </td><td class="mdescRight">Set the sub-rectangle of the texture that the shape will display. <a href="#a2029cc820d1740d14ac794b82525e157">More...</a><br /></td></tr>
|
|
<tr class="separator:a2029cc820d1740d14ac794b82525e157"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3506f9b5d916fec14d583d16f23c2485"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a3506f9b5d916fec14d583d16f23c2485">setFillColor</a> (const <a class="el" href="classsf_1_1Color.html">Color</a> &color)</td></tr>
|
|
<tr class="memdesc:a3506f9b5d916fec14d583d16f23c2485"><td class="mdescLeft"> </td><td class="mdescRight">Set the fill color of the shape. <a href="#a3506f9b5d916fec14d583d16f23c2485">More...</a><br /></td></tr>
|
|
<tr class="separator:a3506f9b5d916fec14d583d16f23c2485"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5978f41ee349ac3c52942996dcb184f7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a5978f41ee349ac3c52942996dcb184f7">setOutlineColor</a> (const <a class="el" href="classsf_1_1Color.html">Color</a> &color)</td></tr>
|
|
<tr class="memdesc:a5978f41ee349ac3c52942996dcb184f7"><td class="mdescLeft"> </td><td class="mdescRight">Set the outline color of the shape. <a href="#a5978f41ee349ac3c52942996dcb184f7">More...</a><br /></td></tr>
|
|
<tr class="separator:a5978f41ee349ac3c52942996dcb184f7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5ad336ad74fc1f567fce3b7e44cf87dc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a5ad336ad74fc1f567fce3b7e44cf87dc">setOutlineThickness</a> (float thickness)</td></tr>
|
|
<tr class="memdesc:a5ad336ad74fc1f567fce3b7e44cf87dc"><td class="mdescLeft"> </td><td class="mdescRight">Set the thickness of the shape's outline. <a href="#a5ad336ad74fc1f567fce3b7e44cf87dc">More...</a><br /></td></tr>
|
|
<tr class="separator:a5ad336ad74fc1f567fce3b7e44cf87dc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a06682d37fd38d8fad56afdd5228b6951"><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_1Shape.html#a06682d37fd38d8fad56afdd5228b6951">getTexture</a> () const</td></tr>
|
|
<tr class="memdesc:a06682d37fd38d8fad56afdd5228b6951"><td class="mdescLeft"> </td><td class="mdescRight">Get the source texture of the shape. <a href="#a06682d37fd38d8fad56afdd5228b6951">More...</a><br /></td></tr>
|
|
<tr class="separator:a06682d37fd38d8fad56afdd5228b6951"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac878aab03c230dc31c44e250d092b9ea"><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_1Shape.html#ac878aab03c230dc31c44e250d092b9ea">getTextureRect</a> () const</td></tr>
|
|
<tr class="memdesc:ac878aab03c230dc31c44e250d092b9ea"><td class="mdescLeft"> </td><td class="mdescRight">Get the sub-rectangle of the texture displayed by the shape. <a href="#ac878aab03c230dc31c44e250d092b9ea">More...</a><br /></td></tr>
|
|
<tr class="separator:ac878aab03c230dc31c44e250d092b9ea"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae3030128824e687f259d18addcf33528"><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_1Shape.html#ae3030128824e687f259d18addcf33528">getFillColor</a> () const</td></tr>
|
|
<tr class="memdesc:ae3030128824e687f259d18addcf33528"><td class="mdescLeft"> </td><td class="mdescRight">Get the fill color of the shape. <a href="#ae3030128824e687f259d18addcf33528">More...</a><br /></td></tr>
|
|
<tr class="separator:ae3030128824e687f259d18addcf33528"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6598feed5fea1325a36b0f3a615ac55c"><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_1Shape.html#a6598feed5fea1325a36b0f3a615ac55c">getOutlineColor</a> () const</td></tr>
|
|
<tr class="memdesc:a6598feed5fea1325a36b0f3a615ac55c"><td class="mdescLeft"> </td><td class="mdescRight">Get the outline color of the shape. <a href="#a6598feed5fea1325a36b0f3a615ac55c">More...</a><br /></td></tr>
|
|
<tr class="separator:a6598feed5fea1325a36b0f3a615ac55c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1d4d5299c573a905e5833fc4dce783a7"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a1d4d5299c573a905e5833fc4dce783a7">getOutlineThickness</a> () const</td></tr>
|
|
<tr class="memdesc:a1d4d5299c573a905e5833fc4dce783a7"><td class="mdescLeft"> </td><td class="mdescRight">Get the outline thickness of the shape. <a href="#a1d4d5299c573a905e5833fc4dce783a7">More...</a><br /></td></tr>
|
|
<tr class="separator:a1d4d5299c573a905e5833fc4dce783a7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af988dd61a29803fc04d02198e44b5643"><td class="memItemLeft" align="right" valign="top">virtual std::size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#af988dd61a29803fc04d02198e44b5643">getPointCount</a> () const =0</td></tr>
|
|
<tr class="memdesc:af988dd61a29803fc04d02198e44b5643"><td class="mdescLeft"> </td><td class="mdescRight">Get the total number of points of the shape. <a href="#af988dd61a29803fc04d02198e44b5643">More...</a><br /></td></tr>
|
|
<tr class="separator:af988dd61a29803fc04d02198e44b5643"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a40e5d83713eb9f0c999944cf96458085"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a40e5d83713eb9f0c999944cf96458085">getPoint</a> (std::size_t index) const =0</td></tr>
|
|
<tr class="memdesc:a40e5d83713eb9f0c999944cf96458085"><td class="mdescLeft"> </td><td class="mdescRight">Get a point of the shape. <a href="#a40e5d83713eb9f0c999944cf96458085">More...</a><br /></td></tr>
|
|
<tr class="separator:a40e5d83713eb9f0c999944cf96458085"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae3294bcdf8713d33a862242ecf706443"><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_1Shape.html#ae3294bcdf8713d33a862242ecf706443">getLocalBounds</a> () const</td></tr>
|
|
<tr class="memdesc:ae3294bcdf8713d33a862242ecf706443"><td class="mdescLeft"> </td><td class="mdescRight">Get the local bounding rectangle of the entity. <a href="#ae3294bcdf8713d33a862242ecf706443">More...</a><br /></td></tr>
|
|
<tr class="separator:ae3294bcdf8713d33a862242ecf706443"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac0e29425d908d5442060cc44790fe4da"><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_1Shape.html#ac0e29425d908d5442060cc44790fe4da">getGlobalBounds</a> () const</td></tr>
|
|
<tr class="memdesc:ac0e29425d908d5442060cc44790fe4da"><td class="mdescLeft"> </td><td class="mdescRight">Get the global (non-minimal) bounding rectangle of the entity. <a href="#ac0e29425d908d5442060cc44790fe4da">More...</a><br /></td></tr>
|
|
<tr class="separator:ac0e29425d908d5442060cc44790fe4da"><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><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
|
|
Protected Member Functions</h2></td></tr>
|
|
<tr class="memitem:a413a457f720835b9f5d8e97ca8b80960"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#a413a457f720835b9f5d8e97ca8b80960">Shape</a> ()</td></tr>
|
|
<tr class="memdesc:a413a457f720835b9f5d8e97ca8b80960"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a413a457f720835b9f5d8e97ca8b80960">More...</a><br /></td></tr>
|
|
<tr class="separator:a413a457f720835b9f5d8e97ca8b80960"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:adfb2bd966c8edbc5d6c92ebc375e4ac1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Shape.html#adfb2bd966c8edbc5d6c92ebc375e4ac1">update</a> ()</td></tr>
|
|
<tr class="memdesc:adfb2bd966c8edbc5d6c92ebc375e4ac1"><td class="mdescLeft"> </td><td class="mdescRight">Recompute the internal geometry of the shape. <a href="#adfb2bd966c8edbc5d6c92ebc375e4ac1">More...</a><br /></td></tr>
|
|
<tr class="separator:adfb2bd966c8edbc5d6c92ebc375e4ac1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Base class for textured shapes with outline. </p>
|
|
<p><a class="el" href="classsf_1_1Shape.html" title="Base class for textured shapes with outline. ">sf::Shape</a> is a drawable class that allows to define and display a custom convex shape on a render target.</p>
|
|
<p>It's only an abstract base, it needs to be specialized for concrete types of shapes (circle, rectangle, convex polygon, star, ...).</p>
|
|
<p>In addition to the attributes provided by the specialized shape classes, a shape always has the following attributes: </p><ul>
|
|
<li>a texture </li>
|
|
<li>a texture rectangle </li>
|
|
<li>a fill color </li>
|
|
<li>an outline color </li>
|
|
<li>an outline thickness</li>
|
|
</ul>
|
|
<p>Each feature is optional, and can be disabled easily: </p><ul>
|
|
<li>the texture can be null </li>
|
|
<li>the fill/outline colors can be <a class="el" href="classsf_1_1Color.html#a569b45471737f770656f50ae7bbac292" title="Transparent (black) predefined color. ">sf::Color::Transparent</a> </li>
|
|
<li>the outline thickness can be zero</li>
|
|
</ul>
|
|
<p>You can write your own derived shape class, there are only two virtual functions to override: </p><ul>
|
|
<li>getPointCount must return the number of points of the shape </li>
|
|
<li>getPoint must return the points of the shape</li>
|
|
</ul>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1RectangleShape.html" title="Specialized shape representing a rectangle. ">sf::RectangleShape</a>, <a class="el" href="classsf_1_1CircleShape.html" title="Specialized shape representing a circle. ">sf::CircleShape</a>, <a class="el" href="classsf_1_1ConvexShape.html" title="Specialized shape representing a convex polygon. ">sf::ConvexShape</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="Shape_8hpp_source.html#l00044">44</a> of file <a class="el" href="Shape_8hpp_source.html">Shape.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a2262aceb9df52d4275c19633592f19bf"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2262aceb9df52d4275c19633592f19bf">◆ </a></span>~Shape()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual sf::Shape::~Shape </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Virtual destructor. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a413a457f720835b9f5d8e97ca8b80960"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a413a457f720835b9f5d8e97ca8b80960">◆ </a></span>Shape()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">sf::Shape::Shape </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Default constructor. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ae3030128824e687f259d18addcf33528"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae3030128824e687f259d18addcf33528">◆ </a></span>getFillColor()</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::Shape::getFillColor </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the fill color of the shape. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Fill color of the shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a3506f9b5d916fec14d583d16f23c2485" title="Set the fill color of the shape. ">setFillColor</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac0e29425d908d5442060cc44790fe4da"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac0e29425d908d5442060cc44790fe4da">◆ </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::Shape::getGlobalBounds </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the global (non-minimal) 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 shape in the global 2D world's coordinate system.</p>
|
|
<p>This function does not necessarily return the <em>minimal</em> bounding rectangle. It merely ensures that the returned rectangle covers all the vertices (but possibly more). This allows for a fast approximation of the bounds as a first check; you may want to use more precise checks on top of that.</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="ae3294bcdf8713d33a862242ecf706443"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae3294bcdf8713d33a862242ecf706443">◆ </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::Shape::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="a6598feed5fea1325a36b0f3a615ac55c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6598feed5fea1325a36b0f3a615ac55c">◆ </a></span>getOutlineColor()</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::Shape::getOutlineColor </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the outline color of the shape. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Outline color of the shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a5978f41ee349ac3c52942996dcb184f7" title="Set the outline color of the shape. ">setOutlineColor</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1d4d5299c573a905e5833fc4dce783a7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1d4d5299c573a905e5833fc4dce783a7">◆ </a></span>getOutlineThickness()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">float sf::Shape::getOutlineThickness </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the outline thickness of the shape. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Outline thickness of the shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a5ad336ad74fc1f567fce3b7e44cf87dc" title="Set the thickness of the shape's outline. ">setOutlineThickness</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a40e5d83713eb9f0c999944cf96458085"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a40e5d83713eb9f0c999944cf96458085">◆ </a></span>getPoint()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> sf::Shape::getPoint </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::size_t </td>
|
|
<td class="paramname"><em>index</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get a point of the shape. </p>
|
|
<p>The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account. The result is undefined if <em>index</em> is out of the valid range.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">index</td><td>Index of the point to get, in range [0 .. <a class="el" href="classsf_1_1Shape.html#af988dd61a29803fc04d02198e44b5643" title="Get the total number of points of the shape. ">getPointCount()</a> - 1]</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>index-th point of the shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#af988dd61a29803fc04d02198e44b5643" title="Get the total number of points of the shape. ">getPointCount</a> </dd></dl>
|
|
|
|
<p>Implemented in <a class="el" href="classsf_1_1ConvexShape.html#a72a97bc426d8daf4d682a20fcb7f3fe7">sf::ConvexShape</a>, <a class="el" href="classsf_1_1CircleShape.html#a2d7f9715502b960b92387102fddb8736">sf::CircleShape</a>, and <a class="el" href="classsf_1_1RectangleShape.html#a3909f1a1946930ff5ae17c26206c0f81">sf::RectangleShape</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af988dd61a29803fc04d02198e44b5643"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af988dd61a29803fc04d02198e44b5643">◆ </a></span>getPointCount()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual std::size_t sf::Shape::getPointCount </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">pure virtual</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the total number of points of the shape. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Number of points of the shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a40e5d83713eb9f0c999944cf96458085" title="Get a point of the shape. ">getPoint</a> </dd></dl>
|
|
|
|
<p>Implemented in <a class="el" href="classsf_1_1CircleShape.html#a014d29ec11e8afa4dce50e7047d99601">sf::CircleShape</a>, <a class="el" href="classsf_1_1RectangleShape.html#adfb2f429e5720c9ccdb26d5996c3ae33">sf::RectangleShape</a>, and <a class="el" href="classsf_1_1ConvexShape.html#a0c54b8d48fe4e13414f6e667dbfc22a3">sf::ConvexShape</a>.</p>
|
|
|
|
</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="a06682d37fd38d8fad56afdd5228b6951"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a06682d37fd38d8fad56afdd5228b6951">◆ </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::Shape::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 shape. </p>
|
|
<p>If the shape 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 shape's texture</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#af8fb22bab1956325be5d62282711e3b6" title="Change the source texture of the shape. ">setTexture</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac878aab03c230dc31c44e250d092b9ea"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac878aab03c230dc31c44e250d092b9ea">◆ </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::Shape::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 shape. </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 shape</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a2029cc820d1740d14ac794b82525e157" title="Set the sub-rectangle of the texture that the shape 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="a3506f9b5d916fec14d583d16f23c2485"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3506f9b5d916fec14d583d16f23c2485">◆ </a></span>setFillColor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::setFillColor </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 fill color of the shape. </p>
|
|
<p>This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use <a class="el" href="classsf_1_1Color.html#a569b45471737f770656f50ae7bbac292" title="Transparent (black) predefined color. ">sf::Color::Transparent</a> to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill 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 shape</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#ae3030128824e687f259d18addcf33528" title="Get the fill color of the shape. ">getFillColor</a>, <a class="el" href="classsf_1_1Shape.html#a5978f41ee349ac3c52942996dcb184f7" title="Set the outline color of the shape. ">setOutlineColor</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="a5978f41ee349ac3c52942996dcb184f7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5978f41ee349ac3c52942996dcb184f7">◆ </a></span>setOutlineColor()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::setOutlineColor </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 outline color of the shape. </p>
|
|
<p>By default, the shape's outline color is opaque white.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">color</td><td>New outline color of the shape</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a6598feed5fea1325a36b0f3a615ac55c" title="Get the outline color of the shape. ">getOutlineColor</a>, <a class="el" href="classsf_1_1Shape.html#a3506f9b5d916fec14d583d16f23c2485" title="Set the fill color of the shape. ">setFillColor</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5ad336ad74fc1f567fce3b7e44cf87dc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5ad336ad74fc1f567fce3b7e44cf87dc">◆ </a></span>setOutlineThickness()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::setOutlineThickness </td>
|
|
<td>(</td>
|
|
<td class="paramtype">float </td>
|
|
<td class="paramname"><em>thickness</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the thickness of the shape's outline. </p>
|
|
<p>Note that negative values are allowed (so that the outline expands towards the center of the shape), and using zero disables the outline. By default, the outline thickness is 0.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">thickness</td><td>New outline thickness</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Shape.html#a1d4d5299c573a905e5833fc4dce783a7" title="Get the outline thickness of the shape. ">getOutlineThickness</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="af8fb22bab1956325be5d62282711e3b6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af8fb22bab1956325be5d62282711e3b6">◆ </a></span>setTexture()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::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 shape. </p>
|
|
<p>The <em>texture</em> argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape 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 shape tries to use it, the behavior is undefined. <em>texture</em> can be NULL to disable texturing. If <em>resetRect</em> is true, the TextureRect property of the shape 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_1Shape.html#a06682d37fd38d8fad56afdd5228b6951" title="Get the source texture of the shape. ">getTexture</a>, <a class="el" href="classsf_1_1Shape.html#a2029cc820d1740d14ac794b82525e157" title="Set the sub-rectangle of the texture that the shape will display. ">setTextureRect</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2029cc820d1740d14ac794b82525e157"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2029cc820d1740d14ac794b82525e157">◆ </a></span>setTextureRect()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::setTextureRect </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">IntRect</a> & </td>
|
|
<td class="paramname"><em>rect</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the sub-rectangle of the texture that the shape 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">rect</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_1Shape.html#ac878aab03c230dc31c44e250d092b9ea" title="Get the sub-rectangle of the texture displayed by the shape. ">getTextureRect</a>, <a class="el" href="classsf_1_1Shape.html#af8fb22bab1956325be5d62282711e3b6" title="Change the source texture of the shape. ">setTexture</a> </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="adfb2bd966c8edbc5d6c92ebc375e4ac1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#adfb2bd966c8edbc5d6c92ebc375e4ac1">◆ </a></span>update()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void sf::Shape::update </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">protected</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Recompute the internal geometry of the shape. </p>
|
|
<p>This function must be called by the derived class everytime the shape's points change (i.e. the result of either getPointCount or getPoint is different). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="Shape_8hpp_source.html">Shape.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>
|