> For the complete documentation index, see [llms.txt](https://danil-dukhovenko.gitbook.io/force/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://danil-dukhovenko.gitbook.io/force/force-scripting-api/forceeditor/guipanel.md).

# GUIPanel

class ForceEditor.GUIPanel

### Description

**GUIPanel** class represents a custom user editor single window/panel that will render throw Dear's ImGui.

\
So **GUIPanel** written on top of Dear's ImGui, its not its wrapper, its will no contains all implementations of ImGui, only limited and basic.

\
When you create a new panel its automatically will be added to global panel array and you can manage it from that.

Methods `Begin` and `End` should be executed only in **`OnRenderGui`**&#x65;vent.

### Constructors

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">GUIPanel</mark></td><td>Create new <mark style="color:red;">GUIPanel</mark> object. Accept the <a href="/force/force-scripting-api/forceeditor/guipanelflags.md">GUIPanelFlags</a>.</td></tr></tbody></table>

### Properties

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">name</mark></td><td><code>Name</code> of this panel. Feel free to change it if you wanna.</td></tr><tr><td><mark style="color:red;">active</mark></td><td>This panel is <code>active</code>?</td></tr><tr><td><mark style="color:red;">flags</mark></td><td>Flags to this panel (they should match real flags as <code>ImGuiWindowFlags_XXX</code>,or you predefined flags <a href="/force/force-scripting-api/forceeditor/gui.md">GUIPanelFlags</a>)</td></tr></tbody></table>

### Static Methods

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">Create</mark></td><td>Create new <mark style="color:red;">GUIPanel</mark> and adds it to array of renderable panels.</td></tr><tr><td><mark style="color:red;">Create(string name)</mark></td><td>Create new <mark style="color:red;">GUIPanel</mark> and adds it to array of renderable panels.</td></tr><tr><td><mark style="color:red;">Remove</mark></td><td>Remove <mark style="color:red;">GUIPanel</mark> from array of renderable panels.</td></tr><tr><td><mark style="color:red;">RemoveAll</mark></td><td>Remove all <mark style="color:red;">GUIPanel's</mark> from array of renderable panels.</td></tr><tr><td><mark style="color:red;">CanBegin</mark></td><td>Returns true if we can begin given <code>panel</code>(e.g its exist and has been created or not begin already), otherwise returns false.</td></tr><tr><td><mark style="color:red;">CanBegin(string name)</mark></td><td>Returns true if we can begin given <code>panel</code> by given name (e.g its exist and has been created or not begin already), otherwise returns false.</td></tr><tr><td><mark style="color:red;">Begin</mark></td><td><p>Starts the context for this panel witch allows to add widgets to.<br><br><strong>Begin/End</strong> can be called multiple times during the frame with the same panel name to append content. Also <code>End()</code> method should be called even if <code>Begin()</code> returns false.<br></p><p>The panel name is used as a unique identifier to preserve panel information across frames.</p></td></tr><tr><td><mark style="color:red;">Begin(string name)</mark></td><td><p>Starts the context for this panel witch allows to add widgets to.<br><br><strong>Begin/End</strong> can be called multiple times during the frame with the same panel name to append content. Also <code>End()</code> method should be called even if <code>Begin()</code> returns false.<br></p><p>The panel name is used as a unique identifier to preserve panel information across frames.</p></td></tr><tr><td><mark style="color:red;">End</mark></td><td><p>End the context for appending widgets to panel.<br></p><p>This method should be called even if <code>Begin()</code> returns false.<br></p><p>Throws <a href="/force/force-scripting-api/forceeditor/guiexception.md">GUIException</a> if executing this method outside <code>OnRenderGui()</code> event.</p></td></tr><tr><td><mark style="color:red;">GetPanel</mark></td><td>Retrive the panel by <code>name</code>.</td></tr><tr><td><mark style="color:red;">GetPanel(int index)</mark></td><td>Get the panel by <code>index</code>.</td></tr><tr><td><mark style="color:red;">GetPanel</mark></td><td>Get the panel by <code>name</code>.<br>Throws <a href="/force/force-scripting-api/forceeditor/guiexception.md">GUIException </a>if panel with input name is not exist.</td></tr></tbody></table>

[GUI](/force/force-scripting-api/forceeditor/gui.md), [GUIException](/force/force-scripting-api/forceeditor/guiexception.md), [GUIPanelFlags](/force/force-scripting-api/forceeditor/guipanelflags.md)
