mirror of
https://github.com/Reuh/ubiquitousse.git
synced 2025-10-27 17:19:31 +00:00
input: fix mouse[N]
This commit is contained in:
parent
336f4f01a5
commit
0c765b315e
14 changed files with 28 additions and 23 deletions
|
|
@ -113,7 +113,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1729,7 +1729,7 @@ its sibling systems (i.e. completely stop the propagation of the event).</li>
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -273,8 +273,8 @@ end
|
|||
<td class="summary">Text input: 1 if the text X was entered, 0 otherwise.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#mouse.N">mouse.N</a></td>
|
||||
<td class="summary">Mouse input: 1 if the mouse button is down, 0 otherwise.</td>
|
||||
<td class="name" nowrap><a href="#mouse">mouse</a></td>
|
||||
<td class="summary">Mouse input: <code>mouse[N]</code> is 1 if the mouse button is down, 0 otherwise.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#mouse.x">mouse.x</a></td>
|
||||
|
|
@ -1374,11 +1374,11 @@ player.fire.event:bind(<span class="string">"pressed"</span>, <span class="keywo
|
|||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "mouse.N"></a>
|
||||
<strong>mouse.N</strong>
|
||||
<a name = "mouse"></a>
|
||||
<strong>mouse</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Mouse input: 1 if the mouse button is down, 0 otherwise.
|
||||
Mouse input: <code>mouse[N]</code> is 1 if the mouse button is down, 0 otherwise.
|
||||
N is either 1 for the primary mouse button, 2 for secondary or 3 for middle button.
|
||||
|
||||
</ul>
|
||||
|
|
@ -1386,6 +1386,11 @@ player.fire.event:bind(<span class="string">"pressed"</span>, <span class="keywo
|
|||
</ul>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">mouse</span>
|
||||
<code>mouse[N]</code>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1636,7 +1641,7 @@ player.fire.event:bind(<span class="string">"pressed"</span>, <span class="keywo
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -2066,7 +2066,7 @@ end
|
|||
Level background. </p>
|
||||
|
||||
<p> If there is a background image, <code>background.image</code> contains a table <code>{image=image, x=number, y=number, sx=number, sy=number}</code>
|
||||
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#Tile.x">x</a> and <a href="../modules/ldtk.html#Layer.y">y</a> are the top-left position,
|
||||
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#IntTile.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a> are the top-left position,
|
||||
and <a href="../modules/ldtk.html#Entity.sx">sx</a> and <a href="../modules/ldtk.html#Entity.sy">sy</a> the horizontal and vertical scale factors.
|
||||
|
||||
</ul>
|
||||
|
|
@ -2142,7 +2142,7 @@ end
|
|||
<li>Enum are converted into a Lua string giving the currently selected enum value.</li>
|
||||
<li>Filepath are converted into a Lua string giving the file path.</li>
|
||||
<li>Arrays are converted into a Lua table with the elements in it as a list.</li>
|
||||
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#Tile.x">x</a> and <a href="../modules/ldtk.html#Layer.y">y</a>, in pixels: <code>{ x=number, y=number }</code>.</li>
|
||||
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#IntTile.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a>, in pixels: <code>{ x=number, y=number }</code>.</li>
|
||||
<li>Colors are converted into a Lua table with the red, green and blue components in [0-1] as a list: <code>{r,g,b}</code>.</li>
|
||||
<li>Tiles are converted into a Lua table { tileset = associated tileset object, quad = associated quad } where <a href="../modules/ldtk.html#Tile.quad">quad</a> is a LÖVE Quad if LÖVE is available, otherwise a table <code>{ x, y, width, height }</code>.</li>
|
||||
<li>EntityRef are converted into a Lua table { level = level, layerIid = layer IID, entityIid = entity IID, entity = see explanation }. If the entity being refernced belongs to another level and this level is not loaded, <code>entity</code> will be nil; otherwise (same level or the other level is also loaded), it will contain the entity.</li>
|
||||
|
|
@ -2170,7 +2170,7 @@ end
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -788,7 +788,7 @@ signal.event:bind("keypressed", function(key, scancode) print("pr
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -1154,7 +1154,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ the repository to save you a few seconds.</p>
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -785,7 +785,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
</div> <!-- id="main" -->
|
||||
<div id="about">
|
||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||
<i style="float:right;">Last updated 2022-09-20 13:52:55 </i>
|
||||
<i style="float:right;">Last updated 2022-09-20 14:48:56 </i>
|
||||
</div> <!-- id="about" -->
|
||||
</div> <!-- id="container" -->
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ signal.event:bind("textinput", function(text)
|
|||
end)
|
||||
|
||||
signal.event:bind("mousepressed", function(x, y, button, istouch, presses)
|
||||
update(("mouse.%s"):format(button), 1)
|
||||
update(("mouse[%s]"):format(button), 1)
|
||||
end)
|
||||
signal.event:bind("mousereleased", function(x, y, button, istouch, presses)
|
||||
update(("mouse.%s"):format(button), 0)
|
||||
update(("mouse[%s]"):format(button), 0)
|
||||
end)
|
||||
|
||||
signal.event:bind("mousemoved", function(x, y, dx, dy, istouch)
|
||||
|
|
|
|||
|
|
@ -791,9 +791,9 @@ input_mt.__index = input_mt
|
|||
-- X can be any text.
|
||||
-- @field text.X
|
||||
|
||||
--- Mouse input: 1 if the mouse button is down, 0 otherwise.
|
||||
--- Mouse input: `mouse[N]` is 1 if the mouse button is down, 0 otherwise.
|
||||
-- N is either 1 for the primary mouse button, 2 for secondary or 3 for middle button.
|
||||
-- @field mouse.N
|
||||
-- @field mouse `mouse[N]`
|
||||
|
||||
--- Mouse input: X position of the mouse cursor in the game window.
|
||||
-- @field mouse.x
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue