-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintelisense.lua
More file actions
156 lines (128 loc) · 5.9 KB
/
intelisense.lua
File metadata and controls
156 lines (128 loc) · 5.9 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
-- This file is not loaded by the engine, only purpose is for intelisense
-- Any functions that takes an entity (e) can accept either:
-- - Entity name
-- - Entity object
-- - Component object
---------------------------------------------------------------------
-- Utilities
---------------------------------------------------------------------
function Log(text) end
function GetScreenRect() end -- Returns 4 values: x,y,w,h
function EmitParticles(pfx, position, angle, scale) end -- Returns the newly created entity containing the PFXComponent
function GetConfig(configName) end -- displayMode (0 or 1), vsync (true or false), musicVolume ([0, 1]), sfxVolume ([0, 1])
function SetConfig(configName, value) end -- displayMode (0 or 1), vsync (true or false), musicVolume ([0, 1]), sfxVolume ([0, 1])
---------------------------------------------------------------------
-- Defining a component
---------------------------------------------------------------------
function RegisterComponent(name, c) end
function SetIntProperty(name, tooltip) end
function SetFloatProperty(name, tooltip) end
function SetVec2Property(name, tooltip) end
function SetColorProperty(name, tooltip) end
function SetStringProperty(name, tooltip) end
---------------------------------------------------------------------
-- Math functions
---------------------------------------------------------------------
function Length(v) end
function Distance(a, b) end
function Normalize(v) end
function Dot(a, b) end
---------------------------------------------------------------------
-- Camera functions
---------------------------------------------------------------------
function GetCameraPosition() end
function SetCameraPosition(pos) end
function GetCameraZoom() end
function SetCameraZoom(zoom) end
---------------------------------------------------------------------
-- Inputs
---------------------------------------------------------------------
function IsKeyDown(key) end
function IsButtonDown(button) end
function IsButtonJustDown(button) end
function GetMousePosition() end
---------------------------------------------------------------------
-- Audio
---------------------------------------------------------------------
function PlaySound(filename, vol, bal, pitch) end
function PlayMusic(filename) end
function StopMusic() end
function PauseMusic() end
function ResumeMusic() end
---------------------------------------------------------------------
-- Events
---------------------------------------------------------------------
function SendEvent(eventName, data) end
function RegisterEvent(eventName, c, functionName) end
function DeregisterEvent(eventName, c) end
---------------------------------------------------------------------
-- Entity functions
---------------------------------------------------------------------
function GetEntity(c) end -- Pass in component or name of entity (entity also works, but pointless)
function GetRoot() end
function GetComponent(e, componentName) end -- Returns the LUA component. You cannot get Built-in components.
function GetName(e) end
function SetName(e, name) end
-- Transforms
function GetPosition(e) end
function SetPosition(e, pos) end
function GetWorldPosition(e) end
function SetWorldPosition(e, pos) end
function GetRotation(e) end
function SetRotation(e, degrees) end
function GetScale(e) end
function SetScale(e, scale) end
-- Parenting
function GetParent(e) end
function AddChild(parent, e) end
-- Lifecycle
function EnableEntity(e) end
function DisableEntity(e) end
function EnableComponent(e, componentName) end -- Lua name, or built-ins: Sprite, Text, etc.
function DisableComponent(e, componentName) end
function CreateEntity(parent) end
function CreateEntity(parent, prefabName) end
function Destroy(e) end -- Destroys the entity (Accepts: component, entity or entity name)
function AddComponent(e, componentName) end -- Lua name, or built-ins: Sprite, Text, etc.
function RemoveComponent(e, componentName) end
---------------------------------------------------------------------
-- Components functions
---------------------------------------------------------------------
function GetSpriteTexture(e) end
function SetSpriteTexture(e, filename) end
function GetSpriteColor(e) end
function SetSpriteColor(e, color) end
function GetSpriteOrigin(e) end
function SetSpriteOrigin(e, origin) end
function GetFont(e) end
function SetFont(e, filename) end
function GetText(e) end
function SetText(e, text) end
function GetTextColor(e) end
function SetTextColor(e, color) end
function GetTextOrigin(e) end
function SetTextOrigin(e, origin) end
function GetTextScale(e) end
function SetTextScale(e, scale) end
function GetPFX(e) end
function SetPFX(e, filename) end
function PlayPFX(e) end
function StopPFX(e) end
function PlayFrameAnim(e, animAnme) end
---------------------------------------------------------------------
-- Entity searching
---------------------------------------------------------------------
-- Root argument is where to start searching. If root is nil, scene root will be used.
function FindEntityByName(root, entityName, pos, searchRadius) end -- Pass 0 for Radius for whole world.
function FindEntitiesByName(root, entityName, pos, searchRadius) end -- Returns array. Pass 0 for Radius for whole world.
function FindEntityByComponent(root, componentTypeName, pos, searchRadius) end -- Pass 0 for Radius for whole world
function FindEntitiesByComponent(root, componentTypeName, pos, searchRadius) end -- eturns array. Pass 0 for Radius for whole world.
---------------------------------------------------------------------
-- State Management
---------------------------------------------------------------------
function ContinueGame() end -- Continue previously started game
function NewGame(filename) end -- Start a new game
function Quit() end -- Close the program
function Editor() end -- Go to the Editor state
function MainMenu() end -- Quit game back to main menu
function Resume() end -- Resume game if we're in the ingame menu