Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed Annotation for 3rd-party Uses #134

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions love_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,15 @@ return {
type = 'function',
name = 'mainLoop',
description = 'Function which handles one frame, including events and rendering, when called. If this is nil then LÖVE exits immediately.',
signature = {
returns = {
{
type = 'any',
name = 'retval',
description = 'Exit code or error message or nil to continue.'
},
},
},
},
},
},
Expand Down Expand Up @@ -958,6 +967,15 @@ return {
type = 'function',
name = 'mainLoop',
description = 'Function which handlers one frame, including events and rendering when called.',
signature = {
returns = {
{
type = 'any',
name = 'retval',
description = 'Exit code or error message or nil to continue.'
},
},
},
},
},
},
Expand Down
6 changes: 6 additions & 0 deletions modules/audio/Audio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ return {
type = 'table',
name = 'effects',
description = 'The list of the names of the currently enabled effects.',
arraytype = 'string',
},
},
},
Expand Down Expand Up @@ -177,6 +178,7 @@ return {
type = 'table',
name = 'devices',
description = 'The list of connected recording devices.',
arraytype = 'RecordingDevice'
},
},
},
Expand Down Expand Up @@ -409,6 +411,7 @@ return {
type = 'table',
name = 'Sources',
description = 'A table containing a list of Sources that were paused by this call.',
arraytype = 'Source',
},
},
},
Expand All @@ -434,6 +437,7 @@ return {
type = 'table',
name = 'sources',
description = 'A table containing a list of Sources to pause.',
arraytype = 'Source',
},
},
},
Expand All @@ -459,6 +463,7 @@ return {
type = 'table',
name = 'sources',
description = 'Table containing a list of Sources to play.',
arraytype = 'Source',
},
},
},
Expand Down Expand Up @@ -731,6 +736,7 @@ return {
type = 'table',
name = 'sources',
description = 'A table containing a list of Sources to stop.',
arraytype = 'Source',
},
},
},
Expand Down
1 change: 1 addition & 0 deletions modules/audio/types/Source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ return {
type = 'table',
name = 'effects',
description = 'A list of the source\'s active effect names.',
arraytype = 'string',
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions modules/event/Event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ return {
type = 'function',
name = 'i',
description = 'Iterator function usable in a for loop.',
signature = {
returns = {
{
type = 'string',
name = 'name',
description = 'Event name.',
},
{
type = 'any',
name = '...',
description = 'Event values.',
},
},
},
},
},
},
Expand Down
10 changes: 10 additions & 0 deletions modules/filesystem/Filesystem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ return {
type = 'table',
name = 'files',
description = 'A sequence with the names of all files and subdirectories as strings.',
arraytype = 'string',
},
},
},
Expand Down Expand Up @@ -494,6 +495,15 @@ return {
type = 'function',
name = 'iterator',
description = 'A function that iterates over all the lines in the file',
signature = {
returns = {
{
type = 'string',
name = 'line',
description = 'Single line in the file.'
},
},
},
},
},
},
Expand Down
9 changes: 9 additions & 0 deletions modules/filesystem/types/File.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ return {
type = 'function',
name = 'iterator',
description = 'The iterator (can be used in for loops).',
signature = {
returns = {
{
type = 'string',
name = 'line',
description = 'Single line in the file.'
},
},
},
},
},
},
Expand Down
41 changes: 24 additions & 17 deletions modules/graphics/Graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ return {
type = 'function',
name = 'callback',
description = 'Function which gets called once the screenshot has been captured. An ImageData is passed into the function as its only argument.',
signature = {
arguments = {
{
type = 'ImageData',
name = 'imageData',
description = 'The resulting screenshot.',
},
},
},
},
},
},
Expand Down Expand Up @@ -273,11 +282,13 @@ return {
type = 'table',
name = 'color',
description = 'A table in the form of {r, g, b, a} containing the color to clear the first active Canvas to.',
arraytype = 'number',
},
{
type = 'table',
name = '...',
description = 'Additional tables for each active Canvas.',
arraytype = 'number',
},
{
type = 'boolean',
Expand Down Expand Up @@ -341,6 +352,7 @@ return {
type = 'table',
name = 'discardcolors',
description = 'An array containing boolean values indicating whether to discard the texture of each active Canvas, when multiple simultaneous Canvases are active.',
arraytype = 'boolean',
},
{
type = 'boolean',
Expand Down Expand Up @@ -959,6 +971,7 @@ return {
type = 'table',
name = 'formats',
description = 'A table containing CanvasFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.',
tabletype = {'PixelFormat', 'boolean'},
},
},
},
Expand All @@ -975,6 +988,7 @@ return {
type = 'table',
name = 'formats',
description = 'A table containing CanvasFormats as keys, and a boolean indicating whether the format is supported as values (taking into account the readable parameter). Not all systems support all formats.',
tabletype = {'PixelFormat', 'boolean'},
},
},
},
Expand Down Expand Up @@ -1176,6 +1190,7 @@ return {
type = 'table',
name = 'formats',
description = 'A table containing PixelFormats as keys, and a boolean indicating whether the format is supported as values. Not all systems support all formats.',
tabletype = {'PixelFormat', 'boolean'},
},
},
},
Expand Down Expand Up @@ -1543,6 +1558,7 @@ return {
type = 'table',
name = 'features',
description = 'A table containing GraphicsFeature keys, and boolean values indicating whether each feature is supported.',
tabletype = {'GraphicsFeature', 'boolean'},
},
},
},
Expand All @@ -1558,6 +1574,7 @@ return {
type = 'table',
name = 'limits',
description = 'A table containing GraphicsLimit keys, and number values.',
tabletype = {'GraphicsLimit', 'number'},
},
},
},
Expand All @@ -1573,6 +1590,7 @@ return {
type = 'table',
name = 'texturetypes',
description = 'A table containing TextureTypes as keys, and a boolean indicating whether the type is supported as values. Not all systems support all types.',
tabletype = {'TextureType', 'boolean'},
},
},
},
Expand Down Expand Up @@ -1740,6 +1758,7 @@ return {
type = 'table',
name = 'points',
description = 'A table of point positions, as described above.',
arraytype = 'number',
},
},
},
Expand Down Expand Up @@ -2456,6 +2475,7 @@ return {
default = '1',
},
},
tablearray = '',
},
{
type = 'MeshDrawMode',
Expand Down Expand Up @@ -3175,23 +3195,7 @@ return {
type = 'table',
name = 'points',
description = 'A table containing multiple point positions, in the form of {x, y, ...}.',
table = {
{
type = 'number',
name = 'x',
description = 'The position of the first point on the x-axis.',
},
{
type = 'number',
name = 'y',
description = 'The position of the first point on the y-axis.',
},
{
type = 'number',
name = '...',
description = 'The x and y coordinates of additional points.',
},
},
arraytype = 'number',
},
},
},
Expand Down Expand Up @@ -3248,6 +3252,7 @@ return {
type = 'table',
name = 'vertices',
description = 'The vertices of the polygon as a table.',
arraytype = 'number',
},
},
},
Expand Down Expand Up @@ -4272,6 +4277,7 @@ return {
type = 'table',
name = 'rgba',
description = 'A numerical indexed table with the red, green, blue and alpha values as numbers. The alpha is optional and defaults to 1 if it is left out.',
arraytype = 'number',
},
},
},
Expand Down Expand Up @@ -4455,6 +4461,7 @@ return {
type = 'table',
name = 'rgba',
description = 'A numerical indexed table with the red, green, blue and alpha values as numbers. The alpha is optional and defaults to 1 if it is left out.',
arraytype = 'number',
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions modules/graphics/types/Canvas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ return {
type = 'function',
name = 'func',
description = 'A function performing drawing operations.',
signature = {
arguments = {
{
type = 'any',
name = '...',
description = 'Additional arguments passed.'
},
},
},
},
{
type = 'any',
name = '...',
description = 'Additional arguments to call the function with.',
},
},
},
Expand Down
1 change: 1 addition & 0 deletions modules/graphics/types/Font.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ return {
type = 'table',
name = 'wrappedtext',
description = 'A sequence containing each line of text that was wrapped.',
arraytype = 'string',
},
},
},
Expand Down
1 change: 1 addition & 0 deletions modules/graphics/types/Mesh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ return {
type = 'table',
name = 'map',
description = 'A table containing the list of vertex indices used when drawing.',
arraytype = 'number',
},
},
},
Expand Down
Loading
Loading