|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <meta name="theme-color" content="#FC7C13"> |
| 7 | + <title>GMLscripts.com :: mouse_has_moved</title> |
| 8 | + <link rel="stylesheet" type="text/css" href="/gmlscripts38.css" /> |
| 9 | + <link rel="icon" type="image/png" href="/favicon.png" /> |
| 10 | + <link rel="alternate" title="GMLscripts.com :: Script Commit History" href="https://github.com/gmlscripts/scripts/commits/master.atom" type="application/rss+xml" /> |
| 11 | + <link href="https://fonts.googleapis.com/css?family=Paytone+One%7CABeeZee%7CSource+Code+Pro" rel="stylesheet" /> |
| 12 | + <script type="text/x-mathjax-config">//<![CDATA[ |
| 13 | + MathJax.Hub.Config({extensions:["tex2jax.js"],jax:["input/TeX","output/HTML-CSS"],tex2jax:{inlineMath:[["\\(","\\)"],['[tex]','[/tex]']],displayMath:[['$$','$$'],["\\[","\\]"]],processEscapes:true},"HTML-CSS":{availableFonts:["TeX"]},menuSettings:{zoom:"Click"},MathZoom:{styles:{"#MathJax_Zoom":{"background-color":"#222","box-shadow":"0px 0px 15px #AAAAAA","-webkit-box-shadow":"0px 0px 15px #AAAAAA","-moz-box-shadow":"0px 0px 15px #AAAAAA","-khtml-box-shadow":"0px 0px 15px #AAAAAA",}}}}); |
| 14 | + MathJax.Hub.Queue(function () { showMathJax(); } );//]]></script> |
| 15 | + <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> |
| 16 | + <script tpye="text/javascript" src="/lunr.js"></script> |
| 17 | + <script type="text/javascript" src="/search.js"></script> |
| 18 | + <script type="text/javascript" src="/gml_string.js"></script> |
| 19 | + <script type="text/javascript" src="/gml_highlight.js"></script> |
| 20 | + <script type="text/javascript" src="/gmlscripts38.js"></script> |
| 21 | +</head> |
| 22 | +<body onload="start()"> |
| 23 | +<noscript><div class="noscript">JAVASCRIPT REQUIRED</div></noscript> |
| 24 | +<header> |
| 25 | + <a href="/" id="home"><img src="/images/38/gmlscripts-header3d.png" alt="GMLscripts.com" width="500" height="40"/></a> |
| 26 | + <nav id="headnav"> |
| 27 | + <ul><li> |
| 28 | + <a href="/script">Scripts</a></li><li> |
| 29 | + <a href="/license">License</a></li><li> |
| 30 | + <a href="/news">News</a></li><li> |
| 31 | + <a href="/search">Search</a></li><li> |
| 32 | + <a href="/submit">Submit</a></li><li> |
| 33 | + <a href="/donate">Donate</a></li><li> |
| 34 | + <a href="https://bsky.app/profile/gmlscripts.com">Follow</a></li> |
| 35 | + </ul> |
| 36 | + </nav> |
| 37 | +</header> |
| 38 | +<div class="wrapper"> |
| 39 | +<main> |
| 40 | +<h1>mouse_has_moved</h1> |
| 41 | +<p>Returns true if the mouse has moved since it was last checked, false otherwise. |
| 42 | +Only movements within the game window or canvas are detected.</p> |
| 43 | +<dl class="script"> |
| 44 | +<dt><a href="/script/mouse_has_moved">mouse_has_moved()</a></dt> |
| 45 | +<dd>Returns true if the mouse has moved since it was last checked, false otherwise.</dd> |
| 46 | +</dl> |
| 47 | +<div class="codebox script"> |
| 48 | +<pre><span class="copy"><a title="Copy to Clipboard" onclick="copyUpdate(this,copyToClipboard('mouse_has_moved'))">COPY</a></span><code class="lang-gml linenums" id="mouse_has_moved">/// @func mouse_has_moved() |
| 49 | +/// |
| 50 | +/// @desc Returns true if the mouse has moved since |
| 51 | +/// it was last checked, false otherwise. |
| 52 | +/// Only movements within the game window or |
| 53 | +/// canvas are detected. |
| 54 | +/// |
| 55 | +/// @return {bool} true if the mouse has moved |
| 56 | +/// |
| 57 | +/// GMLscripts.com/license |
| 58 | + |
| 59 | +function mouse_has_moved() { |
| 60 | + static mx = mouse_x; |
| 61 | + static my = mouse_y; |
| 62 | + if (mx != mouse_x || my != mouse_y) { |
| 63 | + mx = mouse_x; |
| 64 | + my = mouse_y; |
| 65 | + return true; |
| 66 | + } |
| 67 | + return false; |
| 68 | +} |
| 69 | +</code></pre> |
| 70 | +</div> |
| 71 | +<p id="contributors"> |
| 72 | +Contributors: xot |
| 73 | +</p> |
| 74 | +<p id="related"> |
| 75 | +Related: <a href="draw_get_button">draw_get_button</a>, <strong>mouse_has_moved</strong> |
| 76 | +</p> |
| 77 | +<p id="github"> |
| 78 | +GitHub: <a href="https://github.com/gmlscripts/scripts/blob/master/Interaction/Mouse/mouse_has_moved.gml">View</a> · <a href="https://github.com/gmlscripts/scripts/commits/master/Interaction/Mouse/mouse_has_moved.gml">Commits</a> · <a href="https://github.com/gmlscripts/scripts/blame/master/Interaction/Mouse/mouse_has_moved.gml">Blame</a> · <a href="https://github.com/gmlscripts/scripts/raw/master/Interaction/Mouse/mouse_has_moved.gml">Raw</a> |
| 79 | +</p> |
| 80 | +<hr /> |
| 81 | +<!-- DISQUS START --> |
| 82 | +<div id="disqus_thread"></div> |
| 83 | +<script> |
| 84 | +var disqus_config = function () { |
| 85 | +this.page.url = 'https://www.gmlscripts.com/script/mouse_has_moved'; |
| 86 | +this.page.identifier = 'script/mouse_has_moved'; |
| 87 | +}; |
| 88 | + |
| 89 | +(function() { // DON'T EDIT BELOW THIS LINE |
| 90 | +var d = document, s = d.createElement('script'); |
| 91 | +s.src = 'https://gmlscripts.disqus.com/embed.js'; |
| 92 | +s.setAttribute('data-timestamp', +new Date()); |
| 93 | +(d.head || d.body).appendChild(s); |
| 94 | +})(); |
| 95 | +</script> |
| 96 | +<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> |
| 97 | +<!-- DISQUS END --> |
| 98 | + |
| 99 | +</main> |
| 100 | +<nav id="sidenav"> |
| 101 | + <div> |
| 102 | + <span>Scripts</span> |
| 103 | + <ul class="accordion" id="Scripts"> |
| 104 | + <li id="computation" class="computation"> |
| 105 | + <a href="#computation">Computation</a> |
| 106 | + <ul> |
| 107 | + <li><a href="/script/Computation/Base_Conversion/">Base Conversion</a></li> |
| 108 | + <li><a href="/script/Computation/Bitwise/">Bitwise</a></li> |
| 109 | + <li><a href="/script/Computation/Data_Encoding/">Data Encoding</a></li> |
| 110 | + <li><a href="/script/Computation/Data_Encryption/">Data Encryption</a></li> |
| 111 | + <li><a href="/script/Computation/Data_Hashing/">Data Hashing</a></li> |
| 112 | + <li><a href="/script/Computation/Date-Time/">Date-Time</a></li> |
| 113 | + <li><a href="/script/Computation/Geometry/">Geometry</a></li> |
| 114 | + <li><a href="/script/Computation/Parametric_Functions/">Parametric Functions</a></li> |
| 115 | + <li><a href="/script/Computation/Probability/">Probability</a></li> |
| 116 | + <li><a href="/script/Computation/Real_Numbers/">Real Numbers</a></li> |
| 117 | + <li><a href="/script/Computation/Strings/">Strings</a></li> |
| 118 | + </ul> |
| 119 | + </li> |
| 120 | + <li id="data_structures" class="data_structures"> |
| 121 | + <a href="#data_structures">Data Structures</a> |
| 122 | + <ul> |
| 123 | + <li><a href="/script/Data_Structures/Arrays/">Arrays</a></li> |
| 124 | + <li><a href="/script/Data_Structures/Grids/">Grids</a></li> |
| 125 | + <li><a href="/script/Data_Structures/Lists/">Lists</a></li> |
| 126 | + <li><a href="/script/Data_Structures/Maps/">Maps</a></li> |
| 127 | + </ul> |
| 128 | + </li> |
| 129 | + <li id="files" class="files"> |
| 130 | + <a href="#files">Files</a> |
| 131 | + <ul> |
| 132 | + <li><a href="/script/Files/Input_and_Output/">Input and Output</a></li> |
| 133 | + </ul> |
| 134 | + </li> |
| 135 | + <li id="game_play" class="game_play"> |
| 136 | + <a href="#game_play">Game Play</a> |
| 137 | + <ul> |
| 138 | + <li><a href="/script/Game_Play/Artificial_Intelligence/">Artificial Intelligence</a></li> |
| 139 | + <li><a href="/script/Game_Play/Collisions/">Collisions</a></li> |
| 140 | + <li><a href="/script/Game_Play/Instances/">Instances</a></li> |
| 141 | + <li><a href="/script/Game_Play/Movement/">Movement</a></li> |
| 142 | + </ul> |
| 143 | + </li> |
| 144 | + <li id="graphics" class="graphics"> |
| 145 | + <a href="#graphics">Graphics</a> |
| 146 | + <ul> |
| 147 | + <li><a href="/script/Graphics/3D/">3D</a></li> |
| 148 | + <li><a href="/script/Graphics/Backgrounds/">Backgrounds</a></li> |
| 149 | + <li><a href="/script/Graphics/Color/">Color</a></li> |
| 150 | + <li><a href="/script/Graphics/Drawing/">Drawing</a></li> |
| 151 | + <li><a href="/script/Graphics/Shaders/">Shaders</a></li> |
| 152 | + <li><a href="/script/Graphics/Sprites/">Sprites</a></li> |
| 153 | + <li><a href="/script/Graphics/Surfaces/">Surfaces</a></li> |
| 154 | + <li><a href="/script/Graphics/Text/">Text</a></li> |
| 155 | + </ul> |
| 156 | + </li> |
| 157 | + <li id="interaction" class="interaction"> |
| 158 | + <a href="#interaction" class="active">Interaction</a> |
| 159 | + <ul style="max-height: unset;"> |
| 160 | + <li><a href="/script/Interaction/Gamepad/">Gamepad</a></li> |
| 161 | + <li><a href="/script/Interaction/Mouse/">Mouse</a></li> |
| 162 | + </ul> |
| 163 | + </li> |
| 164 | + <li id="platform" class="platform"> |
| 165 | + <a href="#platform">Platform</a> |
| 166 | + <ul> |
| 167 | + <li><a href="/script/Platform/Device/">Device</a></li> |
| 168 | + </ul> |
| 169 | + </li> |
| 170 | + <li id="resources" class="resources"> |
| 171 | + <a href="#resources">Resources</a> |
| 172 | + <ul> |
| 173 | + <li><a href="/script/Resources/Management/">Management</a></li> |
| 174 | + <li><a href="/script/Resources/Sprites/">Sprites</a></li> |
| 175 | + </ul> |
| 176 | + </li> |
| 177 | + </ul> |
| 178 | + <span></span> |
| 179 | + </div> |
| 180 | +</nav> |
| 181 | +</div> |
| 182 | +<footer> |
| 183 | + copyright © 2007-2025, xot media multimixing |
| 184 | + <span><img src="/images/38/x.png" title="web by xot" alt="X" /></span> |
| 185 | +</footer> |
| 186 | +</body> |
| 187 | +</html> |
0 commit comments