From 0c765b315e4da5f26c237366fac11435c442445f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Tue, 20 Sep 2022 14:46:49 +0900 Subject: [PATCH] input: fix mouse[N] --- docs/index.html | 2 +- docs/modules/asset.html | 2 +- docs/modules/ecs.html | 2 +- docs/modules/input.html | 17 +++++++++++------ docs/modules/ldtk.html | 6 +++--- docs/modules/scene.html | 2 +- docs/modules/signal.html | 2 +- docs/modules/timer.html | 2 +- docs/modules/ubiquitousse.html | 2 +- docs/modules/util.html | 2 +- docs/topics/LICENSE.html | 2 +- docs/topics/README.md.html | 2 +- input/event.lua | 4 ++-- input/input.lua | 4 ++-- 14 files changed, 28 insertions(+), 23 deletions(-) diff --git a/docs/index.html b/docs/index.html index 2d52519..edce7ae 100644 --- a/docs/index.html +++ b/docs/index.html @@ -113,7 +113,7 @@
generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
diff --git a/docs/modules/asset.html b/docs/modules/asset.html index aa212a6..65e02c2 100644 --- a/docs/modules/asset.html +++ b/docs/modules/asset.html @@ -337,7 +337,7 @@
generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
diff --git a/docs/modules/ecs.html b/docs/modules/ecs.html index 3b01f9c..9e81029 100644 --- a/docs/modules/ecs.html +++ b/docs/modules/ecs.html @@ -1729,7 +1729,7 @@ its sibling systems (i.e. completely stop the propagation of the event).
generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
diff --git a/docs/modules/input.html b/docs/modules/input.html index 6c6270a..e664153 100644 --- a/docs/modules/input.html +++ b/docs/modules/input.html @@ -273,8 +273,8 @@ end Text input: 1 if the text X was entered, 0 otherwise. - mouse.N - Mouse input: 1 if the mouse button is down, 0 otherwise. + mouse + Mouse input: mouse[N] is 1 if the mouse button is down, 0 otherwise. mouse.x @@ -1374,11 +1374,11 @@ player.fire.event:bind("pressed", - mouse.N + + mouse
- 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. @@ -1386,6 +1386,11 @@ player.fire.event:bind("pressed", mouse + mouse[N] + + @@ -1636,7 +1641,7 @@ player.fire.event:bind("pressed",
generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
diff --git a/docs/modules/ldtk.html b/docs/modules/ldtk.html index 09e1577..f4addef 100644 --- a/docs/modules/ldtk.html +++ b/docs/modules/ldtk.html @@ -2066,7 +2066,7 @@ end Level background.

If there is a background image, background.image contains a table {image=image, x=number, y=number, sx=number, sy=number} - where image is the LÖVE image (or image filepath if LÖVE not available) x and y are the top-left position, + where image is the LÖVE image (or image filepath if LÖVE not available) x and y are the top-left position, and sx and sy the horizontal and vertical scale factors. @@ -2142,7 +2142,7 @@ end

  • Enum are converted into a Lua string giving the currently selected enum value.
  • Filepath are converted into a Lua string giving the file path.
  • Arrays are converted into a Lua table with the elements in it as a list.
  • -
  • Points are converted into a Lua table with the fields x and y, in pixels: { x=number, y=number }.
  • +
  • Points are converted into a Lua table with the fields x and y, in pixels: { x=number, y=number }.
  • Colors are converted into a Lua table with the red, green and blue components in [0-1] as a list: {r,g,b}.
  • Tiles are converted into a Lua table { tileset = associated tileset object, quad = associated quad } where quad is a LÖVE Quad if LÖVE is available, otherwise a table { x, y, width, height }.
  • 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, entity will be nil; otherwise (same level or the other level is also loaded), it will contain the entity.
  • @@ -2170,7 +2170,7 @@ end
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/modules/scene.html b/docs/modules/scene.html index aadeb83..4035f3b 100644 --- a/docs/modules/scene.html +++ b/docs/modules/scene.html @@ -703,7 +703,7 @@
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/modules/signal.html b/docs/modules/signal.html index 3eafbd1..4056eb9 100644 --- a/docs/modules/signal.html +++ b/docs/modules/signal.html @@ -788,7 +788,7 @@ signal.event:bind("keypressed", function(key, scancode) print("pr
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/modules/timer.html b/docs/modules/timer.html index fd8f9ca..7b334ee 100644 --- a/docs/modules/timer.html +++ b/docs/modules/timer.html @@ -1154,7 +1154,7 @@
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/modules/ubiquitousse.html b/docs/modules/ubiquitousse.html index 0a87b43..69a48db 100644 --- a/docs/modules/ubiquitousse.html +++ b/docs/modules/ubiquitousse.html @@ -394,7 +394,7 @@ the repository to save you a few seconds.

    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/modules/util.html b/docs/modules/util.html index d83fe32..b5164a4 100644 --- a/docs/modules/util.html +++ b/docs/modules/util.html @@ -785,7 +785,7 @@
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/topics/LICENSE.html b/docs/topics/LICENSE.html index c85b7e9..baf2ae0 100644 --- a/docs/topics/LICENSE.html +++ b/docs/topics/LICENSE.html @@ -65,7 +65,7 @@
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html index bf62a8c..bb79f30 100644 --- a/docs/topics/README.md.html +++ b/docs/topics/README.md.html @@ -87,7 +87,7 @@
    generated by LDoc 1.4.6 -Last updated 2022-09-20 13:52:55 +Last updated 2022-09-20 14:48:56
    diff --git a/input/event.lua b/input/event.lua index 012bdc6..e88fb14 100644 --- a/input/event.lua +++ b/input/event.lua @@ -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) diff --git a/input/input.lua b/input/input.lua index 42a159f..625bdeb 100644 --- a/input/input.lua +++ b/input/input.lua @@ -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