Debugger GUI Module

Debugger GUI Module


Description

So recently I have been making a FPS project, and I wanted a way to display variables without printing them, as it can be nice. I came up with something simple(super simple) that displays variables and is rather modular.

All it does is store the variables you want to use, then displays them as frames in a GUI and they are updated as much as you want them to be.

image

As I said, it is very simple, but I found it helpful when debugging stuff, and not wanting to print anything.

Advantages

  • You don’t slow down performance with using print()
  • It’s very efficient at displaying
  • It is modular
  • It has random color support :sunglasses: (this is like a total joke but ok)

Using this is very simple, and requires a grand total of 3 brain cells.


Documentation

Creating a debug menu

Debugger.new(DataTemplate(instance), DebugGui(instance), Autoscale(bool), RandomColors(bool))
(You should only ever need to run this once EVER.)

DataTemplate : This is the frame that contains the variable name and the value.

Should look like this image

DebugGui : This is the main GUI where variables are stored, it must follow a format such as this

Should look like this image

(Thanks to this for making my studio look pretty :heart_eyes:)

(The UIListLayout is only needed if Autoscale = true)

Autoscale : This is a boolean deciding if DebugGui.Main should be scaled based off of content size.

RandomColors : Produces this effect. (uses random seed based off of length of value name)

image


returns ClonedGui from DebugGui


Adding/Updating a value

Debugger.UpdateValue(Name, NewValue)

After using Debugger.new(), you can update as many values as you need, keep in mind you need screen space for this.

Example usage:
Debugger.UpdateValue("Hello", "World")

Deleting a value is simple, all you have to do is update a value with a value of nil


Displaying/Updating the GUI

Debugger.DisplayValues()
To update a DebugGui all you have to do is call this function and it will update.
It is best you run this when needed, or after updating all your values.


Download V1 : VersionOne.rbxm (6.7 KB)

If you need help please feel free to leave a comment.

If I left anything out, I’m sorry I forget a lot.

(Last Note: If you encounter any bugs, also let me know)

4 Likes

Nice very informative tutorial of a debugger GUI module