ImmediateGUI

An IMGUI inspired GUI Framework for javascript thats designed to be as simple to use as IMGUI.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/535798/1591785/ImmediateGUI.js

作者
TetteDev
版本
0.0.1.20250519090104
创建于
2025-05-12
更新于
2025-05-19
大小
50.9 KB
许可证
暂无

About ImmediateGUI

An IMGUI inspired GUI Framework for javascript thats designed to be as simple to use as IMGUI. Its actively developed, which means stuff might change and bugs (most definitely) will occur when using this

Supports most of the default controls one could need, can drag the gui around with the mouse, toggle between light/dark mode etc.

For how to use it, check the example code down below (and look at the code of the library)

Example Images (and pseudo code how they were made)

Example 1, Dark Mode

Example 1, Light Mode

const $$ = new ImmediateGUI({
    theme: 'dark',
    position: 'left',
    width: 400,
    draggable: true,
});
$$.Header("Example Header", 5);
$$.Button("Example Button");
$$.Textbox("Example Textbox");
$$.TextArea("Example TextArea");
$$.Label("Example Label");
$$.ProgressBar(64, 0, 100, true);
$$.ColorPicker();
$$.DatePicker();
$$.Dropdown(["Option 1", "Option 2", "Option 3"], "Option 1");
$$.NumberInput("Example Number Input", 0, 0, 100);
$$.Slider(1, 100, 25);
$$.Checkbox("Example Checkbox", true);
$$.BeginSection("Example Section (Non collapsable)", false);
    $$.Button("Control inside section");
    $$.Textbox("Textbox inside section", "GAGA");
$$.EndSection();
$$.BeginSection("Example Section (Collapsable)", true);
    $$.Button("Control inside section");
$$.EndSection();
$$.BeginIndentation(1);
    $$.Button("Indended Control (Level 1)");
$$.EndIndentation();
$$.BeginIndentation(2);
    $$.Button("Indended Control (Level 2)");
$$.EndIndentation();
$$.BeginIndentation(3);
    $$.Button("Indended Control (Level 3)");
$$.EndIndentation();
$$.Label("Example Separator");
$$.Separator();
$$.BeginSection("Example Radio Button Group", true);
    $$.RadioButtons(['Option 1', 'Option 2', 'Option 3'], 'Option 1');
$$.EndSection();
$$.Button("Switch Theme", () => { $$.SetTheme($$.options.theme === 'dark' ? 'light' : 'dark'); });
$$.Show();

Supported Controls in ImmediateGUI Framework

Container Controls

  • Sections - Create collapsible content areas with headers
  • Indentation - Hierarchical layout with customizable levels

Basic UI Elements

  • Button - Standard clickable button with callback support
  • Textbox - Single-line text input field
  • TextArea - Multi-line text input with customizable rows
  • Label - Text display element
  • Header - Section titles with customizable heading levels (h1-h6)
  • Separator - Horizontal dividing line

Form Inputs

  • Checkbox - Boolean toggle with label
  • Radiobox - Group of radio boxes
  • Dropdown - Selection from predefined options
  • Slider - Range input with visual value display
  • NumberInput - Numeric input with min/max constraints
  • DatePicker - Calendar date selection
  • ColorPicker - Visual color selection tool
  • ProgressBar - Visual progress indicator with percentage

Layout Utilities

  • LabelControlPair - Combines a label with any control
  • Section Management - Organized grouping of controls

Dialog Systems

  • Modal - Customizable popup dialogs with various button options

Appearance

  • Themes - Light and dark mode support
  • Draggable Interface - Repositionable UI panel

General Functions

  • Show/Hide/Remove - Control panel visibility
  • GetControlContainer - Access to the main container element
  • GetControls - Retrieve all control elements