-
-
Notifications
You must be signed in to change notification settings - Fork 26
SlabDebug
The SlabDebug module gives developers access to various profiling and editor tools to help them find issues within their own code base or with Slab's code base. This page will go over the various available tools and how the developer may access them. This feature is in on going development so this page will be updated with each new version of Slab released.
Developers have the option to include access to all of the tools listed below through some API calls.
if Slab.BeginMainMenuBar() then
if Slab.BeginMenu("File") then
if Slab.MenuItem("Quit") then
love.event.quit()
end
Slab.EndMenu()
end
SlabDebug.Menu()
Slab.EndMainMenuBar()
end
SlabDebug.Begin()
The about dialog will display information about the current Slab version and the running Love version. Since this is a dialog, the developer will need to call SlabDebug.OpenAbout() function in order for the about dialog to display with calls to SlabDebug.About().
Slab.BeginWindow('About')
if Slab.Button("About") then
SlabDebug.OpenAbout()
end
Slab.EndWindow()
SlabDebug.About()
This debugging option allows developers to inspect the properties of all windows that have had BeginWindow at least called once. This window will also allow the developer to view the window stack to see which one is focused.
Slab.BeginWindow('Basic Window', {Title = "Basic Window"})
Slab.Text("Hello World")
Slab.EndWindow()
SlabDebug.Windows()
This window displays information about the tooltip window. This information is mainly for debugging the tooltip system and not useful for developers, but they have access to it in case of issues.
Slab.BeginWindow('Basic Window', {Title = "Basic Window"})
Slab.Button("Button", {Tooltip = "This is a button."})
Slab.EndWindow()
SlabDebug.Tooltip()
This window mainly displays information about the internal draw commands that are generated through the Slab API calls. This is mainly used internally and will be going through changes in display as more features are implemented.
This window will display various times for stats gathered in the Slab API. Currently, only Slab stats will be displayed. In future versions, there will be support for allowing developers to add their own custom stats for their game to quickly display profiling information without much work needed for the developer.
Slab.BeginWindow('Basic Window', {Title = "Basic Window"})
Slab.Text("Hello World")
Slab.Button("Button")
Slab.EndWindow()
SlabDebug.Performance()
This window allows the developer/end user modify any loaded styles and saves them to disk when requested to do so. Real-time editing of the various Style properties can be done through this window to allow quick iteration of how a style can be created.
SlabDebug.StyleEditor()
Below is a list of functions associated with debugging Slab.
Enable/Disables internal Slab logging. Could be useful for diagnosing problems that occur inside of Slab.
Parameter | Type | Description |
---|---|---|
IsVerbose | Boolean | Flag to enable/disable verbose logging. |