Skip to content

Separator

coding.jackalope edited this page Jul 23, 2020 · 5 revisions
Table of Contents

Overview

Separators are useful for splitting up controls from each, adding some spacing between them. Below are examples of spacing within a window and spacing within a context menu.

Slab.BeginWindow('MyFirstWindow', {Title = "My First Window"})
Slab.Text("Hello World")
Slab.Separator()
Slab.Text("Foo Bar")
Slab.Button("Button 1")
Slab.Separator()
Slab.Button("Button 2")
Slab.EndWindow()

if Slab.BeginContextMenuWindow() then
	Slab.MenuItem("Menu Item 1")
	Slab.MenuItem("Menu Item 2")
	Slab.Separator()
	Slab.MenuItem("Menu Item 3")
	Slab.Separator()
	Slab.MenuItem("Menu Item 4")

	Slab.EndContextMenu()
end

API

Below is a list of functions associated with the Separator API.

Separator

This functions renders a separator line in the window.

Parameter Type Description
Option Table List of options for how this separator will be drawn.
Option Type Description
IncludeBorders Boolean Whether to extend the separator to include the window borders. This is false by default.
H Number The height of the separator. This doesn't change the line thickness, rather, specifies the cursor advancement in the Y direction.
Thickness Number The thickness of the line rendered. The default value is 1.0.
Clone this wiki locally