-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebugging.lua
More file actions
57 lines (43 loc) · 1.89 KB
/
debugging.lua
File metadata and controls
57 lines (43 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--[[
PlayDate SDK Types Meta-File
A collection of type annotations for the PlayDate SDK
Compatible with SDK 1.12.3
This file should NOT actually be imported; VSCode should automatically reference it for type completion.
Importing this file will likely break things, as some functions are redefined for the sake of providing type definition.
Originally written by Minalien (https://cohost.org/Minalien).
Consider this file public domain.
https://sdk.play.date/1.12.3/Inside%20Playdate.html#api-reference
]]
---@meta
--NOTE: print() is deliberately excluded even though it is noted in API doc as it is a standard Lua function.
--[[
Text output from printTable() will be displayed in the simulator’s console, in black if generated by a game running in the simulator or in blue if it’s coming from a plugged-in Playdate device. Printed text is also copied to stdout, which is helpful if you run the simulator from the command line.
https://sdk.play.date/inside-playdate/#f-printTable
]]
---@param table table
function printTable(table) end
--[[
If the simulator is launched from the command line, any extra arguments passed there are available in the playdate.argv array.
https://sdk.play.date/inside-playdate/#v-argv
]]
---@type string[]
playdate.argv = {}
--[[
https://sdk.play.date/inside-playdate/#f-setNewlinePrinted
]]
---@param flag? boolean Whether or not the print() function adds a newline to the end of the printed text. Default is true.
function playdate.setNewlinePrinted(flag) end
--[[
Calculates the current frames per second and draws that value at x, y.
https://sdk.play.date/inside-playdate/#f-drawFPS
]]
---@param x integer
---@param y integer
function playdate.drawFPS(x, y) end
--[[
Returns a single-line stack trace as a string. For example:
main.lua:10 foo() < main.lua:18 (from C)
Use print(where()) to see this trace written to the console.
]]
---@return string
function where() end