From fe2bac6ebde738535f6adc0d16119de6c2c862cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Fri, 7 Oct 2022 12:38:19 +0900 Subject: [PATCH] Update docs --- docs/index.html | 2 +- docs/modules/asset.html | 2 +- docs/modules/ecs.html | 2 +- docs/modules/input.html | 113 ++++++++++++++++++++++++--------- 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/input.lua | 7 +- 13 files changed, 99 insertions(+), 47 deletions(-) diff --git a/docs/index.html b/docs/index.html index edce7ae..c76a1e6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -113,7 +113,7 @@
generated by LDoc 1.4.6 -Last updated 2022-09-20 14:48:56 +Last updated 2022-10-07 12:40:59
diff --git a/docs/modules/asset.html b/docs/modules/asset.html index 65e02c2..2a03f0b 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 14:48:56 +Last updated 2022-10-07 12:40:59
diff --git a/docs/modules/ecs.html b/docs/modules/ecs.html index 9e81029..3716568 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 14:48:56 +Last updated 2022-10-07 12:40:59
diff --git a/docs/modules/input.html b/docs/modules/input.html index e664153..921936a 100644 --- a/docs/modules/input.html +++ b/docs/modules/input.html @@ -159,7 +159,7 @@ end If x < deadzone, returns 0; otherwise returns the value. - clamped (x, y) + normalize (x, y) Returns a normalized version of the vector (x,y), i.e. @@ -186,12 +186,16 @@ end Name of the input. + Input.enabled [read-only] + false if the input is disabled, true otherwise. + + Input.grabbed [read-only] - false if the input is currently not grabbed, a subInput otherwise. + false if the input is currently not grabbed, the grabbing Input otherwise. Input.grabbing [read-only] - false if the input is not a subinput, the Input it was grabbed from otherwise. + false if the input is not grabbing another input, the Input it is grabbing from otherwise. Input.event @@ -202,7 +206,7 @@ end Update the input and its children. - Input:clone () + Input:clone ([copyState=false]) Create a new input object based on this input config data. @@ -214,20 +218,24 @@ end Disable the input and its children, preventing further updates and events. + Input:enable () + Enable the input and its children, allowing further updates and events. + + Input:onNextActiveSource (fn[, filter]) Will call fn(source) on the next activated source (including sources not currently used by this input). Input:grab () - Grab the input and its children input and returns the new subinput. + Grab the input and its children and returns the resulting grabbing input. Input:release () - Release a subinput and its children. + Release an input that is currently grabbing another and its children. Input:neutralize () - Set the state of this input to a neutral position (i.e. + Set the state of this input and its children to a neutral position (i.e. Input:setJoystick (joystick) @@ -688,8 +696,8 @@ player.fire.event:bind("pressed", - clamped (x, y) + + normalize (x, y)
Returns a normalized version of the vector (x,y), i.e. “clamp” the returned x,y coordinates into a circle of radius 1. @@ -892,14 +900,32 @@ player.fire.event:bind("pressed", + Input.enabled [read-only] + +
+ false if the input is disabled, true otherwise. + If the input is disabled, its children are also disabled. + + + + + + + + + + +
Input.grabbed [read-only]
- false if the input is currently not grabbed, a subInput otherwise. - This may be different between each subinput. + false if the input is currently not grabbed, the grabbing Input otherwise. @@ -917,8 +943,7 @@ player.fire.event:bind("pressed", Input it was grabbed from otherwise. - This may be different between each subinput. + false if the input is not grabbing another input, the Input it is grabbing from otherwise. @@ -936,7 +961,7 @@ player.fire.event:bind("pressed", "pressed", "pressed", pressed and released may never return true and delta might be wrong).

-

(Note: this should not be called on subinputs) +

If the input is grabbed, will update the input that grabbed it instead.

+ +

(Note: this do not need to be called on inputs that are grabbing another input as the grabbed input will update it automatically) @@ -983,16 +1009,25 @@ player.fire.event:bind("pressed", - Input:clone () + Input:clone ([copyState=false])

Create a new input object based on this input config data. + Unless copyState is set, the clone will only keep the config data and the input name; other state will be set to the default values. +

Parameters:

+
    +
  • copyState + boolean + if true, will copy the currrent state of the input into the clone. The input states includes the current input value, if it is enabled/disabled, and the current joystick; note that the grabbed state (i.e. the grabbed and grabbing fields) is not copied. + (default false) +
  • +
@@ -1005,7 +1040,6 @@ player.fire.event:bind("pressed", config, and do the same for its children. - This will reenable the input if it was disabled using disable. @@ -1024,7 +1058,26 @@ player.fire.event:bind("pressed", reload. + The input can be reenabled using enable. + + + + + + + + + + + +
+
+ + Input:enable () +
+
+ Enable the input and its children, allowing further updates and events. + The should be called after disabling the input using disable. @@ -1071,15 +1124,15 @@ player.fire.event:bind("pressed", release the subinput.

+

Grabbed inputs are set to a neutral position and disabled (will no longer update) and will instead pass all new updates to the grabbing input.

-

This will also reset the input to a neutral state. The subinput will share everything with this input, except - grabbed, grabbing, event (a new event registry is created), and of course its current state. +

This is typically used for contextual action or pause menus: by grabbing the player input, all the direct use of + this input in the game will stop (can’t move caracter, …) and instead you can use the grabbing input to handle input in the pause menu. + To stop grabbing an input, you will need to call release on the grabbing input.

+ +

The grabbing input is created by cloning the current input and starts with the same state as the input when it was grabbed. @@ -1097,8 +1150,8 @@ player.fire.event:bind("pressed", "pressed", "pressed",

generated by LDoc 1.4.6 -Last updated 2022-09-20 14:48:56 +Last updated 2022-10-07 12:40:59
diff --git a/docs/modules/ldtk.html b/docs/modules/ldtk.html index f4addef..6bcca65 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/modules/scene.html b/docs/modules/scene.html index 4035f3b..c48edf3 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/modules/signal.html b/docs/modules/signal.html index 4056eb9..7a39cd0 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/modules/timer.html b/docs/modules/timer.html index 7b334ee..3abef1f 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/modules/ubiquitousse.html b/docs/modules/ubiquitousse.html index 69a48db..92e2bb4 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/modules/util.html b/docs/modules/util.html index b5164a4..e7d3fca 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/topics/LICENSE.html b/docs/topics/LICENSE.html index baf2ae0..31fba8b 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/docs/topics/README.md.html b/docs/topics/README.md.html index bb79f30..e9c7f06 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 14:48:56 +Last updated 2022-10-07 12:40:59
    diff --git a/input/input.lua b/input/input.lua index ce56741..0876888 100644 --- a/input/input.lua +++ b/input/input.lua @@ -667,10 +667,9 @@ input_mt = { event:bind("_active", onevent) end, - --- Grab the input and its children input and returns the resulting grabbing input. + --- Grab the input and its children and returns the resulting grabbing input. -- - -- The input will be disabled (will no longer update) and instead pass all new updates to the grabbing input. - -- The input will also be set to a neutral position. + -- Grabbed inputs are set to a neutral position and disabled (will no longer update) and will instead pass all new updates to the grabbing input. -- -- This is typically used for contextual action or pause menus: by grabbing the player input, all the direct use of -- this input in the game will stop (can't move caracter, ...) and instead you can use the grabbing input to handle input in the pause menu. @@ -693,7 +692,7 @@ input_mt = { end end, --- Release an input that is currently grabbing another and its children. - -- The parent grabbed input will be re-enabled (will update again). This grabbing input will be reset to a neutral position and disabled. + -- The parent grabbed input will be re-enabled (will update again). This grabbing input will be reset to a neutral position and disabled when released. release = function(self) assert(self.grabbing, "can't release an input that is not grabbing another input") self:disable()