SDLU/docs/html/class_mouse.html
2021-04-24 02:01:36 +02:00

387 lines
19 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SDL Utility: Mouse Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SDL Utility
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_mouse.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="class_mouse-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Mouse Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A static class that contains/handles data about mouse position and button states.
<a href="class_mouse.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_mouse_8hpp_source.html">Mouse.hpp</a>&gt;</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:a2189c95ac90001266b97105c25085270"><td class="memItemLeft" align="right" valign="top">enum class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Button</a> { <br />
&#160;&#160;<a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270a945d5e233cf7d6240f6b783b36a374ff">Left</a> = 1
, <a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270a92b09c7c48c520c3c55e497875da437c">Right</a> = 2
, <a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270ab1ca34f82e83c52b010f86955f264e05">Middle</a> = 3
, <a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270aac8e5aa1a680bd64e6fb9313db5b4428">XButton1</a> = 4
, <br />
&#160;&#160;<a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270a7af9d9a16f813c045a3dbe8068a13f4d">XButton2</a> = 5
<br />
}</td></tr>
<tr class="memdesc:a2189c95ac90001266b97105c25085270"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_mouse.html" title="A static class that contains/handles data about mouse position and button states.">Mouse</a> buttons. <a href="class_mouse.html#a2189c95ac90001266b97105c25085270">More...</a><br /></td></tr>
<tr class="separator:a2189c95ac90001266b97105c25085270"><td class="memSeparator" colspan="2">&#160;</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:a07faafbfb9f42a45b155fdd0c98a027b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_util_8hpp.html#add440eff171ea5f55cb00c4a9ab8672d">Uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#a07faafbfb9f42a45b155fdd0c98a027b">GetButtonState</a> ()</td></tr>
<tr class="memdesc:a07faafbfb9f42a45b155fdd0c98a027b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current mouse button state. <a href="class_mouse.html#a07faafbfb9f42a45b155fdd0c98a027b">More...</a><br /></td></tr>
<tr class="separator:a07faafbfb9f42a45b155fdd0c98a027b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03c02466c8713509e0bed311e55520a6"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#a03c02466c8713509e0bed311e55520a6">IsButtonDown</a> (<a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Button</a> button)</td></tr>
<tr class="memdesc:a03c02466c8713509e0bed311e55520a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if a specific button is pressed. <a href="class_mouse.html#a03c02466c8713509e0bed311e55520a6">More...</a><br /></td></tr>
<tr class="separator:a03c02466c8713509e0bed311e55520a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab18b92fb5eb5fecf6918d0dcbe696a2a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#ab18b92fb5eb5fecf6918d0dcbe696a2a">GetPosition</a> ()</td></tr>
<tr class="memdesc:ab18b92fb5eb5fecf6918d0dcbe696a2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the absolute position of the mouse. <a href="class_mouse.html#ab18b92fb5eb5fecf6918d0dcbe696a2a">More...</a><br /></td></tr>
<tr class="separator:ab18b92fb5eb5fecf6918d0dcbe696a2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad92df5406cb8d429314fa17eaa40ce1e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#ad92df5406cb8d429314fa17eaa40ce1e">GetPosition</a> (const <a class="el" href="class_render_window.html">RenderWindow</a> &amp;relativeTo)</td></tr>
<tr class="memdesc:ad92df5406cb8d429314fa17eaa40ce1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets current relative position of the mouse. <a href="class_mouse.html#ad92df5406cb8d429314fa17eaa40ce1e">More...</a><br /></td></tr>
<tr class="separator:ad92df5406cb8d429314fa17eaa40ce1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf9d858fb89d23a9227602c169b209f5"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#adf9d858fb89d23a9227602c169b209f5">SetPosition</a> (const <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> &amp;position)</td></tr>
<tr class="memdesc:adf9d858fb89d23a9227602c169b209f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the absolute position of the mouse. <a href="class_mouse.html#adf9d858fb89d23a9227602c169b209f5">More...</a><br /></td></tr>
<tr class="separator:adf9d858fb89d23a9227602c169b209f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa904df11f52c1484e0630144c6e4e0e"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_mouse.html#aaa904df11f52c1484e0630144c6e4e0e">SetPosition</a> (const <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> &amp;position, const <a class="el" href="class_render_window.html">RenderWindow</a> &amp;relativeTo)</td></tr>
<tr class="memdesc:aaa904df11f52c1484e0630144c6e4e0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets current relative position of the mouse. <a href="class_mouse.html#aaa904df11f52c1484e0630144c6e4e0e">More...</a><br /></td></tr>
<tr class="separator:aaa904df11f52c1484e0630144c6e4e0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A static class that contains/handles data about mouse position and button states. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a2189c95ac90001266b97105c25085270"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2189c95ac90001266b97105c25085270">&#9670;&nbsp;</a></span>Button</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Mouse::Button</a></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="class_mouse.html" title="A static class that contains/handles data about mouse position and button states.">Mouse</a> buttons. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a2189c95ac90001266b97105c25085270a945d5e233cf7d6240f6b783b36a374ff"></a>Left&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2189c95ac90001266b97105c25085270a92b09c7c48c520c3c55e497875da437c"></a>Right&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2189c95ac90001266b97105c25085270ab1ca34f82e83c52b010f86955f264e05"></a>Middle&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2189c95ac90001266b97105c25085270aac8e5aa1a680bd64e6fb9313db5b4428"></a>XButton1&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a2189c95ac90001266b97105c25085270a7af9d9a16f813c045a3dbe8068a13f4d"></a>XButton2&#160;</td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a07faafbfb9f42a45b155fdd0c98a027b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07faafbfb9f42a45b155fdd0c98a027b">&#9670;&nbsp;</a></span>GetButtonState()</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="_util_8hpp.html#add440eff171ea5f55cb00c4a9ab8672d">Uint32</a> Mouse::GetButtonState </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>Returns the current mouse button state. </p>
<dl class="section return"><dt>Returns</dt><dd>A 32-bit mask of the current button state </dd></dl>
</div>
</div>
<a id="ab18b92fb5eb5fecf6918d0dcbe696a2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab18b92fb5eb5fecf6918d0dcbe696a2a">&#9670;&nbsp;</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="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> 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>Gets the absolute position of the mouse. </p>
<dl class="section return"><dt>Returns</dt><dd>Current mouse position relative to screen </dd></dl>
</div>
</div>
<a id="ad92df5406cb8d429314fa17eaa40ce1e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad92df5406cb8d429314fa17eaa40ce1e">&#9670;&nbsp;</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="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> Mouse::GetPosition </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_render_window.html">RenderWindow</a> &amp;&#160;</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>Gets current relative position of the mouse. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">relativeTo</td><td>The window the mouse position should be relative to </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The position of the mouse relative to the top left of the passed window object </dd></dl>
</div>
</div>
<a id="a03c02466c8713509e0bed311e55520a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03c02466c8713509e0bed311e55520a6">&#9670;&nbsp;</a></span>IsButtonDown()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool Mouse::IsButtonDown </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_mouse.html#a2189c95ac90001266b97105c25085270">Button</a>&#160;</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>Checks if a specific button is pressed. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">button</td><td>The button to check </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if the button is pressed </dd></dl>
</div>
</div>
<a id="adf9d858fb89d23a9227602c169b209f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf9d858fb89d23a9227602c169b209f5">&#9670;&nbsp;</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 Mouse::SetPosition </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> &amp;&#160;</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>Sets the absolute position of the mouse. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>A 2D vector of the new position </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="aaa904df11f52c1484e0630144c6e4e0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa904df11f52c1484e0630144c6e4e0e">&#9670;&nbsp;</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 Mouse::SetPosition </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="_vector2_8hpp.html#aa83d444bd6cbecb112158663c2e0c213">Vector2i</a> &amp;&#160;</td>
<td class="paramname"><em>position</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="class_render_window.html">RenderWindow</a> &amp;&#160;</td>
<td class="paramname"><em>relativeTo</em>&#160;</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>Sets current relative position of the mouse. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">position</td><td>A 2D vector of the new position </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">relativeTo</td><td>The window the mouse position should be relative to </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>C:/Users/Robert/source/repos/SDLU/include/structures/<a class="el" href="_mouse_8hpp_source.html">Mouse.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_mouse.html">Mouse</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>