358 lines
22 KiB
HTML
358 lines
22 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_1Mouse.html">Mouse</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<a href="classsf_1_1Mouse-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">sf::Mouse Class Reference<div class="ingroups"><a class="el" href="group__window.html">Window module</a></div></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Give access to the real-time state of the mouse.
|
|
<a href="classsf_1_1Mouse.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="Mouse_8hpp_source.html">Mouse.hpp</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:a4fb128be433f9aafe66bc0c605daaa90"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90">Button</a> { <br />
|
|
  <a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90a8bb4856e1ec7f6b6a8605effdfc0eee8">Left</a>,
|
|
<a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90af2cff24ab6c26daf079b11189f982fc4">Right</a>,
|
|
<a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90a2c353189c4b11cf216d7caddafcc609d">Middle</a>,
|
|
<a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90aecc7f3ce9ad6a60b9b0027876446b8d7">XButton1</a>,
|
|
<br />
|
|
  <a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90a03fa056fd0dd9d629c205d91a8ef1b5a">XButton2</a>,
|
|
<a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90a52a1d434289774240ddaa22496762402">ButtonCount</a>
|
|
<br />
|
|
}</td></tr>
|
|
<tr class="memdesc:a4fb128be433f9aafe66bc0c605daaa90"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">Mouse</a> buttons. <a href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90">More...</a><br /></td></tr>
|
|
<tr class="separator:a4fb128be433f9aafe66bc0c605daaa90"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a60dd479a43f26f200e7957aa11803ff4"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#a60dd479a43f26f200e7957aa11803ff4">Wheel</a> { <a class="el" href="classsf_1_1Mouse.html#a60dd479a43f26f200e7957aa11803ff4abd571de908d2b2c4b9f165f29c678496">VerticalWheel</a>,
|
|
<a class="el" href="classsf_1_1Mouse.html#a60dd479a43f26f200e7957aa11803ff4a785768d5e33c77de9fdcfdd02219f4e2">HorizontalWheel</a>
|
|
}</td></tr>
|
|
<tr class="memdesc:a60dd479a43f26f200e7957aa11803ff4"><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">Mouse</a> wheels. <a href="classsf_1_1Mouse.html#a60dd479a43f26f200e7957aa11803ff4">More...</a><br /></td></tr>
|
|
<tr class="separator:a60dd479a43f26f200e7957aa11803ff4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
|
Static Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:ab647159eb88e369a0332a9c5a7ba6687"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#ab647159eb88e369a0332a9c5a7ba6687">isButtonPressed</a> (<a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90">Button</a> button)</td></tr>
|
|
<tr class="memdesc:ab647159eb88e369a0332a9c5a7ba6687"><td class="mdescLeft"> </td><td class="mdescRight">Check if a mouse button is pressed. <a href="#ab647159eb88e369a0332a9c5a7ba6687">More...</a><br /></td></tr>
|
|
<tr class="separator:ab647159eb88e369a0332a9c5a7ba6687"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac368680f797b7f6e4f50b5b7928c1387"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#ac368680f797b7f6e4f50b5b7928c1387">getPosition</a> ()</td></tr>
|
|
<tr class="memdesc:ac368680f797b7f6e4f50b5b7928c1387"><td class="mdescLeft"> </td><td class="mdescRight">Get the current position of the mouse in desktop coordinates. <a href="#ac368680f797b7f6e4f50b5b7928c1387">More...</a><br /></td></tr>
|
|
<tr class="separator:ac368680f797b7f6e4f50b5b7928c1387"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a93b4d2ebef728e77a0ec9d83c1e0b0c8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#a93b4d2ebef728e77a0ec9d83c1e0b0c8">getPosition</a> (const <a class="el" href="classsf_1_1Window.html">Window</a> &relativeTo)</td></tr>
|
|
<tr class="memdesc:a93b4d2ebef728e77a0ec9d83c1e0b0c8"><td class="mdescLeft"> </td><td class="mdescRight">Get the current position of the mouse in window coordinates. <a href="#a93b4d2ebef728e77a0ec9d83c1e0b0c8">More...</a><br /></td></tr>
|
|
<tr class="separator:a93b4d2ebef728e77a0ec9d83c1e0b0c8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1222e16c583be9e3d176d86e0b7817d7"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#a1222e16c583be9e3d176d86e0b7817d7">setPosition</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> &position)</td></tr>
|
|
<tr class="memdesc:a1222e16c583be9e3d176d86e0b7817d7"><td class="mdescLeft"> </td><td class="mdescRight">Set the current position of the mouse in desktop coordinates. <a href="#a1222e16c583be9e3d176d86e0b7817d7">More...</a><br /></td></tr>
|
|
<tr class="separator:a1222e16c583be9e3d176d86e0b7817d7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad9b16ec7041531315f06b26b413dfea8"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Mouse.html#ad9b16ec7041531315f06b26b413dfea8">setPosition</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> &position, const <a class="el" href="classsf_1_1Window.html">Window</a> &relativeTo)</td></tr>
|
|
<tr class="memdesc:ad9b16ec7041531315f06b26b413dfea8"><td class="mdescLeft"> </td><td class="mdescRight">Set the current position of the mouse in window coordinates. <a href="#ad9b16ec7041531315f06b26b413dfea8">More...</a><br /></td></tr>
|
|
<tr class="separator:ad9b16ec7041531315f06b26b413dfea8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>Give access to the real-time state of the mouse. </p>
|
|
<p><a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">sf::Mouse</a> provides an interface to the state of the mouse.</p>
|
|
<p>It only contains static functions (a single mouse is assumed), so it's not meant to be instantiated.</p>
|
|
<p>This class allows users to query the mouse state at any time and directly, without having to deal with a window and its events. Compared to the MouseMoved, MouseButtonPressed and MouseButtonReleased events, <a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">sf::Mouse</a> can retrieve the state of the cursor and the buttons at any time (you don't need to store and update a boolean on your side in order to know if a button is pressed or released), and you always get the real state of the mouse, even if it is moved, pressed or released when your window is out of focus and no event is triggered.</p>
|
|
<p>The setPosition and getPosition functions can be used to change or retrieve the current position of the mouse pointer. There are two versions: one that operates in global coordinates (relative to the desktop) and one that operates in window coordinates (relative to a specific window).</p>
|
|
<p>Usage example: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="classsf_1_1Mouse.html#ab647159eb88e369a0332a9c5a7ba6687">sf::Mouse::isButtonPressed</a>(<a class="code" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90a8bb4856e1ec7f6b6a8605effdfc0eee8">sf::Mouse::Left</a>))</div><div class="line">{</div><div class="line"> <span class="comment">// left click...</span></div><div class="line">}</div><div class="line"></div><div class="line"><span class="comment">// get global mouse position</span></div><div class="line"><a class="code" href="classsf_1_1Vector2.html">sf::Vector2i</a> position = <a class="code" href="classsf_1_1Mouse.html#ac368680f797b7f6e4f50b5b7928c1387">sf::Mouse::getPosition</a>();</div><div class="line"></div><div class="line"><span class="comment">// set mouse position relative to a window</span></div><div class="line"><a class="code" href="classsf_1_1Mouse.html#a1222e16c583be9e3d176d86e0b7817d7">sf::Mouse::setPosition</a>(<a class="code" href="classsf_1_1Vector2.html">sf::Vector2i</a>(100, 200), window);</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Joystick.html" title="Give access to the real-time state of the joysticks. ">sf::Joystick</a>, <a class="el" href="classsf_1_1Keyboard.html" title="Give access to the real-time state of the keyboard. ">sf::Keyboard</a>, <a class="el" href="classsf_1_1Touch.html" title="Give access to the real-time state of the touches. ">sf::Touch</a> </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Mouse_8hpp_source.html#l00043">43</a> of file <a class="el" href="Mouse_8hpp_source.html">Mouse.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
|
|
<a id="a4fb128be433f9aafe66bc0c605daaa90"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4fb128be433f9aafe66bc0c605daaa90">◆ </a></span>Button</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90">sf::Mouse::Button</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p><a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">Mouse</a> buttons. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90a8bb4856e1ec7f6b6a8605effdfc0eee8"></a>Left </td><td class="fielddoc"><p>The left mouse button. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90af2cff24ab6c26daf079b11189f982fc4"></a>Right </td><td class="fielddoc"><p>The right mouse button. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90a2c353189c4b11cf216d7caddafcc609d"></a>Middle </td><td class="fielddoc"><p>The middle (wheel) mouse button. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90aecc7f3ce9ad6a60b9b0027876446b8d7"></a>XButton1 </td><td class="fielddoc"><p>The first extra mouse button. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90a03fa056fd0dd9d629c205d91a8ef1b5a"></a>XButton2 </td><td class="fielddoc"><p>The second extra mouse button. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a4fb128be433f9aafe66bc0c605daaa90a52a1d434289774240ddaa22496762402"></a>ButtonCount </td><td class="fielddoc"><p>Keep last – the total number of mouse buttons. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Mouse_8hpp_source.html#l00051">51</a> of file <a class="el" href="Mouse_8hpp_source.html">Mouse.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a60dd479a43f26f200e7957aa11803ff4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a60dd479a43f26f200e7957aa11803ff4">◆ </a></span>Wheel</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="classsf_1_1Mouse.html#a60dd479a43f26f200e7957aa11803ff4">sf::Mouse::Wheel</a></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p><a class="el" href="classsf_1_1Mouse.html" title="Give access to the real-time state of the mouse. ">Mouse</a> wheels. </p>
|
|
<table class="fieldtable">
|
|
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a60dd479a43f26f200e7957aa11803ff4abd571de908d2b2c4b9f165f29c678496"></a>VerticalWheel </td><td class="fielddoc"><p>The vertical mouse wheel. </p>
|
|
</td></tr>
|
|
<tr><td class="fieldname"><a id="a60dd479a43f26f200e7957aa11803ff4a785768d5e33c77de9fdcfdd02219f4e2"></a>HorizontalWheel </td><td class="fielddoc"><p>The horizontal mouse wheel. </p>
|
|
</td></tr>
|
|
</table>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="Mouse_8hpp_source.html#l00066">66</a> of file <a class="el" href="Mouse_8hpp_source.html">Mouse.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ac368680f797b7f6e4f50b5b7928c1387"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac368680f797b7f6e4f50b5b7928c1387">◆ </a></span>getPosition() <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">static <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> sf::Mouse::getPosition </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the current position of the mouse in desktop coordinates. </p>
|
|
<p>This function returns the global position of the mouse cursor on the desktop.</p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Current position of the mouse </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a93b4d2ebef728e77a0ec9d83c1e0b0c8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a93b4d2ebef728e77a0ec9d83c1e0b0c8">◆ </a></span>getPosition() <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">static <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> sf::Mouse::getPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Window.html">Window</a> & </td>
|
|
<td class="paramname"><em>relativeTo</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Get the current position of the mouse in window coordinates. </p>
|
|
<p>This function returns the current position of the mouse cursor, relative to the given window.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">relativeTo</td><td>Reference window</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>Current position of the mouse </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab647159eb88e369a0332a9c5a7ba6687"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab647159eb88e369a0332a9c5a7ba6687">◆ </a></span>isButtonPressed()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static bool sf::Mouse::isButtonPressed </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classsf_1_1Mouse.html#a4fb128be433f9aafe66bc0c605daaa90">Button</a> </td>
|
|
<td class="paramname"><em>button</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Check if a mouse button is pressed. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">button</td><td>Button to check</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>True if the button is pressed, false otherwise </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1222e16c583be9e3d176d86e0b7817d7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1222e16c583be9e3d176d86e0b7817d7">◆ </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">static void sf::Mouse::setPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2i</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">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the current position of the mouse in desktop coordinates. </p>
|
|
<p>This function sets the global position of the mouse cursor on the desktop.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">position</td><td>New position of the mouse </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ad9b16ec7041531315f06b26b413dfea8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ad9b16ec7041531315f06b26b413dfea8">◆ </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">static void sf::Mouse::setPosition </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2i</a> & </td>
|
|
<td class="paramname"><em>position</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="classsf_1_1Window.html">Window</a> & </td>
|
|
<td class="paramname"><em>relativeTo</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">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Set the current position of the mouse in window coordinates. </p>
|
|
<p>This function sets the current position of the mouse cursor, relative to the given window.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">position</td><td>New position of the mouse </td></tr>
|
|
<tr><td class="paramname">relativeTo</td><td>Reference window </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="Mouse_8hpp_source.html">Mouse.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>
|