@rbxts/gizmos 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/index.d.ts CHANGED
@@ -8,6 +8,12 @@
8
8
  */
9
9
 
10
10
  interface Gizmos {
11
+ /**
12
+ * Whether gizmos are enabled and will be rendered
13
+ * @default true
14
+ */
15
+ enabled: boolean;
16
+
11
17
  /**
12
18
  * Whether to automatically clear gizmos each frame
13
19
  * @default true
package/out/init.lua CHANGED
@@ -7,6 +7,7 @@ local trailers = {}
7
7
 
8
8
  local hitColor, missColor = 'green', 'red'
9
9
 
10
+ Gizmos.enabled = true
10
11
  Gizmos.clear = true
11
12
 
12
13
  local colors = {
@@ -461,7 +462,22 @@ end
461
462
  findOrMakeGizmos()
462
463
  findOrMakeLabel()
463
464
 
465
+ local previousEnabled = true
466
+
464
467
  local function Update(dt)
468
+ if not Gizmos.enabled then
469
+ if previousEnabled then
470
+ -- Just disabled, clear everything
471
+ wfh:Clear()
472
+ if label then
473
+ label.Text = ''
474
+ end
475
+ previousEnabled = false
476
+ end
477
+ commands = {}
478
+ return
479
+ end
480
+ previousEnabled = true
465
481
  local t = tick()
466
482
  if t ~= wfh:GetAttribute('lastUpdateTime') then
467
483
  wfh:SetAttribute('lastUpdateTime', t)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/gizmos",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "TypeScript port of sg3cko's Gizmos library - Debug drawing utilities for Roblox including shapes, raycasts, paths, and world-space text.",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {