Skip to content

Commit 9c4f5f0

Browse files
Update docs
1 parent 228a4d6 commit 9c4f5f0

17 files changed

Lines changed: 660 additions & 136 deletions

docs/modules/Color.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Color
22

3-
**Description:** Class: Color
3+
**Description:**
44

5-
## Methods
6-
7-
### `__tostring`
5+
Color instances can be created using color names defined in `Color.string_colors`,
6+
self-regsitered color names (using the `RegisterNamedColor` method),
7+
hex strings, ABGR uint_32, RGBA floats (0 - 1), and RGBA numbers (0 - 255).
88

9+
## Methods
910

1011
### `new`
1112

@@ -16,44 +17,52 @@ Returns a new `Color` instance.
1617
**Parameters:**
1718
- `...` any
1819

20+
1921
**Returns:**
2022
- `Color`
2123

2224
### `RegisterNamedColor`
2325

2426
Allows you to register new named colors in the Color class itself
25-
26-
that you can call later using `Color.new("your_custom_color_name")`
27+
that you can call later using `Color("your_custom_color_name")`
2728

2829
Example usage:
2930

31+
```lua
3032
Color:RegisterNamedColor("Magenta", "#FF00FF")
31-
32-
You can then use it like so:
33-
34-
local r, g, b, a = Color.new("Magenta"):AsRGBA()
33+
local r, g, b, a = Color("Magenta"):AsRGBA()
34+
```
3535

3636
**Parameters:**
3737
- `name` string
3838
- `...` any
3939

40+
41+
4042
### `AsRGBA`
4143

4244
Returns a color in **RGBA** format.
4345

44-
4546
**Returns:**
4647
- `number` , number, number, number
4748

4849
### `AsFloat`
4950

5051
Returns a color in float format.
5152

53+
**Returns:**
54+
- `float` , float, float, float
5255

53-
### `AsU32`
56+
### `AsHex`
5457

55-
Returns a uint32 color in **ABGR** format.
58+
Returns a color hex string.
59+
60+
**Returns:**
61+
- `string` |nil
62+
63+
### `AsU32`
5664

65+
Returns a uint_32 color in **ABGR** format.
5766

5867
**Returns:**
5968
- `number`

docs/modules/Decorator.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Decorator
22

3-
**Description:** Class: Decorator
4-
**Global Singleton.**
5-
- Custom decorator to mark entities owned by this script.
3+
**Description:**
4+
5+
Custom decorator to mark entities owned by this script.
66

77
## Methods
88

@@ -12,35 +12,47 @@
1212
- `entity` integer
1313
- `key` string
1414

15+
16+
1517
### `ExistsOn`
1618

1719
**Parameters:**
1820
- `entity` integer
1921
- `key` string
2022
- `expectedValue` any
2123

24+
25+
2226
### `RegisterEntity`
2327

2428
**Parameters:**
2529
- `entity` integer
2630
- `key` string
2731
- `value` any
2832

33+
34+
2935
### `RemoveEntity`
3036

3137
**Parameters:**
3238
- `entity` integer
3339
- `key` string
3440

41+
42+
3543
### `Validate`
3644

3745
only bool decorators for now
3846

3947
**Parameters:**
4048
- `entity` integer
4149

50+
51+
4252
### `DebugDump`
4353

4454
**Parameters:**
4555
- `entity` integer
4656

57+
58+

docs/modules/Entity.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Entity
22

3-
**Description:** Class: Entity
3+
**Description:**
4+
45
Class representing a GTA V entity.
56

67
## Methods
@@ -13,6 +14,7 @@ Class representing a GTA V entity.
1314
**Parameters:**
1415
- `handle` number
1516

17+
1618
**Returns:**
1719
- `Entity` |nil
1820

@@ -26,21 +28,20 @@ Class representing a GTA V entity.
2628
- `isNetwork?` boolean
2729
- `isScriptHostPed?` boolean
2830

29-
### `Exists`
3031

3132

33+
### `Exists`
34+
3235
**Returns:**
3336
- `boolean`
3437

3538
### `GetHandle`
3639

37-
3840
**Returns:**
3941
- `number`
4042

4143
### `GetModelHash`
4244

43-
4445
**Returns:**
4546
- `number`
4647

@@ -49,6 +50,7 @@ Class representing a GTA V entity.
4950
**Parameters:**
5051
- `bIsAlive?` boolean
5152

53+
5254
**Returns:**
5355
- `vec3`
5456

@@ -57,42 +59,37 @@ Class representing a GTA V entity.
5759
**Parameters:**
5860
- `rotationOrder?` integer
5961

62+
6063
**Returns:**
6164
- `vec3`
6265

6366
### `GetForwardVector`
6467

65-
6668
**Returns:**
6769
- `vec3`
6870

6971
### `GetForwardX`
7072

71-
7273
**Returns:**
7374
- `number`
7475

7576
### `GetForwardY`
7677

77-
7878
**Returns:**
7979
- `number`
8080

8181
### `GetForwardZ`
8282

83-
8483
**Returns:**
8584
- `number`
8685

8786
### `GetMaxHealth`
8887

89-
9088
**Returns:**
9189
- `integer`
9290

9391
### `GetHealth`
9492

95-
9693
**Returns:**
9794
- `integer`
9895

@@ -101,24 +98,22 @@ Class representing a GTA V entity.
10198
**Parameters:**
10299
- `offset?` number
103100

101+
104102
**Returns:**
105103
- `number`
106104

107105
### `GetSpeed`
108106

109-
110107
**Returns:**
111108
- `number`
112109

113110
### `GetVelocity`
114111

115-
116112
**Returns:**
117113
- `vec3`
118114

119115
### `GetHeightAboveGround`
120116

121-
122117
**Returns:**
123118
- `number`
124119

@@ -129,6 +124,7 @@ Class representing a GTA V entity.
129124
- `offset_y` number
130125
- `offset_z` number
131126

127+
132128
**Returns:**
133129
- `vec3`
134130

@@ -139,6 +135,7 @@ Class representing a GTA V entity.
139135
- `offset_y` number
140136
- `offset_z` number
141137

138+
142139
**Returns:**
143140
- `vec3`
144141

@@ -147,21 +144,29 @@ Class representing a GTA V entity.
147144
**Parameters:**
148145
- `boneName` string
149146

147+
148+
150149
### `GetBonePosition`
151150

152151
**Parameters:**
153152
- `bone` string|number
154153

154+
155+
155156
### `GetBoneRotation`
156157

157158
**Parameters:**
158159
- `bone` string|number
159160

161+
162+
160163
### `GetWorldPositionOfBone`
161164

162165
**Parameters:**
163166
- `bone` string|number
164167

168+
169+
165170
### `SetCoords`
166171

167172
**Parameters:**
@@ -171,6 +176,8 @@ Class representing a GTA V entity.
171176
- `zAxis?` boolean
172177
- `clearArea?` boolean
173178

179+
180+
174181
### `SetCoordsNoOffset`
175182

176183
**Parameters:**
@@ -179,6 +186,8 @@ Class representing a GTA V entity.
179186
- `yAxis?` boolean
180187
- `zAxis?` boolean
181188

189+
190+
182191
### `GetSpawnPosInFront`
183192

184193
Will be improved later.
@@ -189,18 +198,26 @@ Will be improved later.
189198
**Parameters:**
190199
- `keep_physics?` boolean
191200

201+
202+
192203
### `DisableCollision`
193204

194205
**Parameters:**
195206
- `keep_physics?` boolean
196207

208+
209+
197210
### `ToggleInvincibility`
198211

199212
**Parameters:**
200213
- `toggle` boolean
201214

215+
216+
202217
### `DrawBoundingBox`
203218

204219
**Parameters:**
205220
- `color` Color
206221

222+
223+

0 commit comments

Comments
 (0)