An open API service indexing awesome lists of open source software.

https://github.com/ericoporto/agsimgui

Dear ImGui plugin for Adventure Game Studio
https://github.com/ericoporto/agsimgui

adventure-game-studio adventuregamestudio ags dear-imgui

Last synced: 6 months ago
JSON representation

Dear ImGui plugin for Adventure Game Studio

Awesome Lists containing this project

README

          

[b][size=14pt]agsimgui[/size][/b]  [color=gray][b] version 0.3.0 [/b][/color]

[img]https://dev.azure.com/ericoporto/agsimgui/_apis/build/status/ericoporto.agsimgui?branchName=master[/img]

[url=https://github.com/ericoporto/agsimgui/releases/download/0.3.0/agsimgui.dll]Get Latest Release [b]agsimgui.dll[/b][/url] | [url=https://github.com/ericoporto/agsimgui/releases/download/0.3.0/libagsimgui.so][b]libagsimgui.so[/b][/url] | [url=https://github.com/ericoporto/agsimgui/releases/download/0.3.0/libagsimgui.dylib][b]libagsimgui.dylib[/b][/url] | [url=https://github.com/ericoporto/agsimgui]GitHub Repo[/url] | [b][url=https://github.com/ericoporto/agsimgui/releases/download/0.3.0/agsimgui_demo_windows.zip]Demo Windows[/url][/b] | [b][url=https://github.com/ericoporto/agsimgui/releases/download/0.3.0/agsimgui_demo_linux.tar.xz]Demo Linux[/url][/b]

Dear ImGui plugin for Adventure Game Studio

[img]https://user-images.githubusercontent.com/2244442/71694439-f3ac1080-2d8d-11ea-9c98-e6954409b66b.gif[/img]

Supports Directx9 and Software renderer. Using OpenGL will default to Software renderer for ImGui only (it has it's own renderer), but OpenGL support will be provided in the future.

A more complete documentation [url=https://github.com/ericoporto/agsimgui/blob/master/README.md]is available here[/url].

[b][size=12pt]Usage example[/size][/b]

Run a simple demo window to see what's possible with Dear ImGui.
[code=AGS]
// use function room_RepExec() when in Room Script and link it throught the editor
void repeatedly_execute(){
  AgsImGui.NewFrame(); //let's begin a new frame, we end it with a Render
  AgsImGui.ShowDemoWindow(); //Shows a demo of everything possible
  AgsImGui.Render(); // This will generate drawing instructions.
  // AGS will actually draw this on screen later on, on Post Screen Draw stage.
}
[/code]
Some of what is shown on Demo Window is not yet exposed in the AgsImGui Script API.

Let's do a simple example now.
[code=AGS]
bool is_button_clicked;

// use function room_RepExec() when in Room Script and link it throught the editor
void repeatedly_execute(){
  AgsImGui.NewFrame(); //let's begin a new frame, we end it with a Render

AgsImGui.BeginWindow("My first window");   
  ViewFrame* vf = Game.GetViewFrame(player.View, player.Loop, player.Frame);
  is_button_clicked = AgsImGui.ImageButton(vf.Graphic);
  if(AgsImGui.IsItemHovered()) AgsImGui.SetTooltip(String.Format("frame %d",player.Frame));
  player.x = AgsImGui.DragInt("player.x", player.x);
  player.y = AgsImGui.DragInt("player.y", player.y);
  AgsImGui.EndWindow();

AgsImGui.Render(); // This will generate drawing instructions.
  // AGS will actually draw this on screen later on, on Post Screen Draw stage.
}
[/code]
Note ImGui will save a [tt]imgui.ini[/tt] file to allow window positions and some more data to persist between sections when no guidance is given.

[b][size=12pt]AGS Script API[/size][/b]
[spoiler]
[i][b]Main[/b][/i]

[*] [b][tt]AgsImGui.NewFrame[/tt][/b]

[code]static void AgsImGui.NewFrame()[/code]

Call this before calling any AgsImGui commands.

[*] [b][tt]AgsImGui.EndFrame[/tt][/b]

[code]static void AgsImGui.EndFrame()[/code]

We don't need this if we are using Render, since it will automatically call [tt]AgsImGui.EndFrame()[/tt] too.

[*] [b][tt]AgsImGui.Render[/tt][/b]

[code]static void AgsImGui.Render()[/code]

This will EndFrame and proceed to generate drawing instructions.

[*] [b][tt]AgsImGui.GetStyle[/tt][/b]

[code]static ImGuiStyle* AgsImGui.GetStyle()[/code]

Gets the Style customization use in AgsImGui. Check [tt]ImGuiStyle[/tt] for more information.

[*] [b][tt]AgsImGui.SetStyle[/tt][/b]

[code]static void AgsImGui.SetStyle(ImGuiStyle* imGuiStyle)[/code]

Sets the Style customization use in AgsImGui. Check [tt]ImGuiStyle[/tt] for more information.

[code=AGS]
ImGuiStyle* style = AgsImGui.GetStyle();
style.Alpha = 0.5
style.Colors[eImGuiCol_PopupBg] = ImVec4.Create(1.00, 1.00, 1.00, 1.00); //white
AgsImGui.SetStyle(style);
[/code]

[i][b]Demo, Debug, Information[/b][/i]

[*] [b][tt]AgsImGui.GetVersion[/tt][/b]

[code]static String AgsImGui.GetVersion()[/code]

[*] [b][tt]AgsImGui.ShowDemoWindow[/tt][/b]

[code]static void AgsImGui.ShowDemoWindow()[/code]

[*] [b][tt]AgsImGui.ShowAboutWindow[/tt][/b]

[code]static void AgsImGui.ShowAboutWindow()[/code]

[*] [b][tt]AgsImGui.ShowMetricsWindow[/tt][/b]

[code]static void AgsImGui.ShowMetricsWindow()[/code]

[*] [b][tt]AgsImGui.ShowUserGuide[/tt][/b]

[code]static void AgsImGui.ShowUserGuide()[/code]

[hr]

[i][b]Windows[/b][/i]

[*] [b][tt]AgsImGui.BeginWindow[/tt][/b]

[code]static AgsImGui.ImGuiBeginWindow BeginWindow(String name, bool has_close_button = 0, ImGuiWindowFlags flags = 0)[/code]

[*] [b][tt]AgsImGui.EndWindow[/tt][/b]

[code]static void EndWindow()[/code]

[hr]

[i][b]Child Windows[/b][/i]

[*] [b][tt]AgsImGui.BeginChild[/tt][/b]

[code]static bool BeginChild(String str_id, int width = 0, int height = 0, bool border = false, ImGuiWindowFlags flags = 0)[/code]

Child Windows. Always call a matching EndChild() for each BeginChild() call, regardless of its return value. Child windows can embed their own child.

[*] [b][tt]AgsImGui.EndChild[/tt][/b]

[code]static void EndChild()[/code]

Pop child window from the stack.

[hr]

[i][b]Item/Widgets Utilities[/b][/i]

Most of the functions are referring to the last/previous item we submitted.

[*] [b][tt]AgsImGui.IsItemHovered[/tt][/b]

[code]static bool AgsImGui.IsItemHovered(ImGuiHoveredFlags flags = 0)[/code]

Is the last item hovered? (and usable, aka not blocked by a popup, etc.). You can specify a flag for more options.

static bool IsItemHovered(ImGuiHoveredFlags flags = 0)

[*] [b][tt]AgsImGui.IsItemActive[/tt][/b]

[code]static bool AgsImGui.IsItemActive()[/code]

Is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item.)

[*] [b][tt]AgsImGui.IsItemFocused[/tt][/b]

[code]static bool AgsImGui.IsItemFocused()[/code]

Is the last item focused for keyboard navigation?

[*] [b][tt]AgsImGui.IsItemVisible[/tt][/b]

[code]static bool AgsImGui.IsItemVisible()[/code]

Is the last item visible? (items may be out of sight because of clipping/scrolling)

[*] [b][tt]AgsImGui.IsItemEdited[/tt][/b]

[code]static bool AgsImGui.IsItemEdited()[/code]

Did the last item modify its underlying value this frame? or was pressed? This is generally the same as the bool return value of many widgets.

[*] [b][tt]AgsImGui.IsItemActivated[/tt][/b]

[code]static bool AgsImGui.IsItemActivated()[/code]

Was the last item just made active (item was previously inactive).

[*] [b][tt]AgsImGui.IsItemDeactivated[/tt][/b]

[code]static bool AgsImGui.IsItemDeactivated()[/code]

Was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.

[*] [b][tt]AgsImGui.IsItemDeactivatedAfterEdit[/tt][/b]

[code]static bool AgsImGui.IsItemDeactivatedAfterEdit()[/code]

Was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing.

[*] [b][tt]AgsImGui.IsItemToggledOpen[/tt][/b]

[code]static bool AgsImGui.IsItemToggledOpen()[/code]

Was the last item open state toggled? set by TreeNode().

[*] [b][tt]AgsImGui.IsAnyItemHovered[/tt][/b]

[code]static bool AgsImGui.IsAnyItemHovered()[/code]

is any item hovered?

[*] [b][tt]AgsImGui.IsAnyItemActive[/tt][/b]

[code]static bool AgsImGui.IsAnyItemActive()[/code]

is any item active?

[*] [b][tt]AgsImGui.IsAnyItemFocused[/tt][/b]

[code]static bool AgsImGui.IsAnyItemFocused()[/code]

is any item focused?

[*] [b][tt]AgsImGui.IsWindowAppearing[/tt][/b]

[code]static bool AgsImGui.IsWindowAppearing()[/code]

'current window' = the window we are appending into while inside a Begin()/End() block.

[*] [b][tt]AgsImGui.IsWindowCollapsed[/tt][/b]

[code]static bool AgsImGui.IsWindowCollapsed()[/code]

return true when window is collapsed. Use this between Begin and End of a window.

[*] [b][tt]AgsImGui.IsWindowFocused[/tt][/b]

[code]static bool AgsImGui.IsWindowFocused(ImGuiFocusedFlags flags=0)[/code]

is current window focused? or its root/child, depending on flags. see flags for options. Use this between Begin and End of a window.

[*] [b][tt]AgsImGui.IsWindowHovered[/tt][/b]

[code]static bool AgsImGui.IsWindowHovered(ImGuiHoveredFlags flags=0)[/code]

is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. Use this between Begin and End of a window.

[hr]

[i][b]Widgets: Text[/b][/i]

[*] [b][tt]AgsImGui.Text[/tt][/b]

[code]static void AgsImGui.Text(String text)[/code]

Draws a string of text.

[*] [b][tt]AgsImGui.TextColored[/tt][/b]

[code]static void AgsImGui.TextColored(int ags_color, String text)[/code]

shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();

[*] [b][tt]AgsImGui.TextDisabled[/tt][/b]

[code]static void AgsImGui.TextDisabled(String text)[/code]

shortcut for PushStyleColor(ImGuiCol[cur]Text, style.Colors[ImGuiCol[/cur]TextDisabled]); Text(fmt, ...); PopStyleColor();

[*] [b][tt]AgsImGui.TextWrapped[/tt][/b]

[code]static void AgsImGui.TextWrapped(String text)[/code]

shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();.

[*] [b][tt]AgsImGui.LabelText[/tt][/b]

[code]static void AgsImGui.LabelText(String label, String text)[/code]

Display text+label aligned the same way as value+label widgets .

[*] [b][tt]AgsImGui.Bullet[/tt][/b]

[code]static void AgsImGui.Bullet(String text)[/code]

Draws a bullet and a string of text. Shortcut for Bullet()+Text().

[hr]

[i][b]Widgets: Main[/b][/i]

Most widgets return true when the value has been changed or when pressed/selected.

You may also use one of the many IsItemXXX functions (e.g. IsItemActive, IsItemHovered, etc.) to query widget state.

[*] [b][tt]AgsImGui.Button[/tt][/b]

[code]static bool AgsImGui.Button(String label, int width = 0, int height = 0)[/code]

Creates a button. Returns true while button is pressed.

[*] [b][tt]AgsImGui.SmallButton[/tt][/b]

[code]static bool AgsImGui.SmallButton(String label)[/code]

Creates a button with no padding to be easier to embed within text. Returns true while button is pressed.

[*] [b][tt]AgsImGui.Image[/tt][/b]

[code]static void AgsImGui.Image(int sprite_id)[/code]

Create an image with passed sprite ID.

[*] [b][tt]AgsImGui.ImageButton[/tt][/b]

[code]static bool AgsImGui.ImageButton(int sprite_id)[/code]

Create a button with an image with passed sprite ID. Returns true while button is pressed.

[*] [b][tt]AgsImGui.ArrowButton[/tt][/b]

[code]static bool AgsImGui.ArrowButton(String label, ImGuiDir dir)[/code]

Creates a button with an arrow shape. Returns true while button is pressed.

[*] [b][tt]AgsImGui.Checkbox[/tt][/b]

[code]static bool AgsImGui.Checkbox(String label, bool initial_value)[/code]

Creates a checkbox button. Returns true when button is marked.

[*] [b][tt]AgsImGui.RadioButton[/tt][/b]

[code]static bool AgsImGui.RadioButton(String label, bool active)[/code]

Creates a radio button. Returns true while button is marked.

[*] [b][tt]AgsImGui.Bullet[/tt][/b]

[code]static void AgsImGui.Bullet()[/code]

Draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses .

[hr]

[i][b]Widgets: Selectables[/b][/i]

A selectable highlights when hovered, and can display another color when selected.

[*] [b][tt]AgsImGui.Selectable[/tt][/b]

[code]static bool AgsImGui.Selectable(String label, bool selected = false, ImGuiSelectableFlags flags = 0, int width = 0, int height = 0)[/code]

bool selected carry the selection state (read-only). When Selectable() is clicked it returns true so you can modify your selection state.

[hr]

[i][b]Widgets: Drag[/b][/i]

CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped and can go off-bounds.

[*] [b][tt]AgsImGui.DragFloat[/tt][/b]

[code]static float AgsImGui.DragFloat(String label, float value, float min_value = 0, float max_value = 0, float speed = 0, String format = 0)[/code]

Returns the current value of the drag box. Format string uses regular [code]"%f"[/code] specifiers, so you can use to define how many decimals you want.

[*] [b][tt]AgsImGui.DragInt[/tt][/b]

[code]static int AgsImGui.DragInt(String label, int value, int min_value = 0, int max_value = 0, float speed = 0, String format = 0)[/code]

Returns the current value of the drag box. Format string uses regular [code]"%d"[/code], you can use it to specify left most zeroes.

[hr]

[i][b]Widgets: Slider[/b][/i]

CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped and can go off-bounds.

[*] [b][tt]AgsImGui.SliderFloat[/tt][/b]

[code]static float AgsImGui.SliderFloat(String label, float value, float min_value = 0, float max_value = 0, String format = 0)[/code]

Returns the current value of the slider. Format string uses regular [code]"%f"[/code] specifiers, so you can use to define how many decimals you want.

[*] [b][tt]AgsImGui.SliderInt[/tt][/b]

[code]static int AgsImGui.SliderInt(String label, int value, int min_value = 0, int max_value = 0, String format = 0)[/code]

Returns the current value of the slider. Format string uses regular [code]"%d"[/code], you can use it to specify left most zeroes.

[hr]

[i][b]Widgets: Input with Keyboard[/b][/i]

[*] [b][tt]AgsImGui.InputText[/tt][/b]

[code]static String AgsImGui.InputText(String label, String text_buffer, int buffer_size, ImGuiInputTextFlags flags =0)[/code]

Pass a string to identify the input field as label, this label is going to be used for ID and can't be empty.

Remember that we don't save state between frames, so you have to do this yourself by reapplying the output to input as needed.

This function returns [tt]null[/tt] when the input hasn't changed, and returns a string with all the text, when it has been modified.

This widget supports Ctrl+Z for undo, Ctrl+X for Cut, Ctrl+C for copy, Ctrl+V for pasting, mouse selection and cursor navigation with arrows.
Behavior can be modified by passing flags, see the enums section. Flags can be combined with bitwise operations.

Example:
[code=AGS]
String input_string;
function room_RepExec() {
AgsImGui.NewFrame();
// buff
String out_string = AgsImGui.InputText("type here!",input_string, 128);
if(out_string!=null) input_string = out_string;

AgsImGui.Render();
}

function room_Load() {
input_string = "Hello String!";
}[/code]

[*] [b][tt]AgsImGui.InputTextMultiline[/tt][/b]

[code]static String AgsImGui.InputTextMultiline(String label, String text_buffer, int buffer_size, int width=0, int height=0, ImGuiInputTextFlags flags = 0)[/code]

Same as InputText, but allows controlling the input size and supports multiline text.

[*] [b][tt]AgsImGui.InputTextWithHint[/tt][/b]

[code]static String AgsImGui.InputTextWithHint(String label, String hint, String text_buffer, int buffer_size, ImGuiInputTextFlags flags = 0)[/code]

Same as InputText, but supports passing an input hint text.

[hr]

[i][b]Widgets: Combobox commands[/b][/i]

[*] [b][tt]AgsImGui.BeginCombo[/tt][/b]

[code]static bool AgsImGui.BeginCombo(String label, String preview_value, ImGuiComboFlags flags = 0);[/code]

The BeginCombo()/EndCombo() allows to manage your contents and selection state however you want it, by creating e.g. Selectable() items.

Example:
[code=AGS]
bool option1;
bool option2;
if(AgsImGui.BeginCombo("My combo","click me!")){
  option1 = AgsImGui.Selectable("Option 1");
  option2 = AgsImGui.Selectable("Option 2");
  AgsImGui.EndCombo();
}
[/code]

[*] [b][tt]AgsImGui.EndCombo[/tt][/b]

[code]static void EndCombo()[/code]

Only call EndCombo() if BeginCombo() returns true!

[hr]

[i][b]Widgets: List Boxes commands[/b][/i]

[*] [b][tt]AgsImGui.BeginListBox[/tt][/b]

[code]static bool AgsImGui.BeginListBox(String label, int items_count, int height_in_items = -1);[/code]

The BeginListBox()/EndListBox() allows to manage your contents and selection state however you want it, by creating e.g. Selectable() items.

Example:
[code=AGS]
bool option1;
bool option2;
if(AgsImGui.BeginListBox("My ListBox",2)){
  option1 = AgsImGui.Selectable("Option 1");
  option2 = AgsImGui.Selectable("Option 2");
  AgsImGui.EndListBox();
}
[/code]

[*] [b][tt]AgsImGui.EndListBox[/tt][/b]

[code]static void AgsImGui.EndListBox()[/code]

Only call EndListBox() if BeginListBox() returns true!

[hr]

[i][b]Widgets: Trees[/b][/i]

TreeNode functions return true when the node is open, in which case you need to also call TreePop() when you are finished displaying the tree node contents.

[*] [b][tt]AgsImGui.TreeNode[/tt][/b]

[code]static bool AgsImGui.TreeNode(String label)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreeNodeWithID[/tt][/b]

[code]static bool AgsImGui.TreeNodeWithID(String str_id, String text)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreeNodeV[/tt][/b]

[code]static bool AgsImGui.TreeNodeV(String str_id, String text)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreeNodeEx[/tt][/b]

[code]static bool AgsImGui.TreeNodeEx(String label, ImGuiTreeNodeFlags flags = 0)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreeNodeExWithID[/tt][/b]

[code]static bool AgsImGui.TreeNodeExWithID(String str_id, ImGuiTreeNodeFlags flags, String text)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreeNodeExV[/tt][/b]

[code]static bool AgsImGui.TreeNodeExV(String str_id, ImGuiTreeNodeFlags flags, String text)[/code]

Show the contents and call TreePop() at the end, if this returns true.

[*] [b][tt]AgsImGui.TreePush[/tt][/b]

[code]static void AgsImGui.TreePush(String str_id)[/code]

~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.

[*] [b][tt]AgsImGui.TreePop[/tt][/b]

[code]static void AgsImGuiTreePop()[/code]

~ Unindent()+PopId().

[*] [b][tt]AgsImGui.GetTreeNodeToLabelSpacing[/tt][/b]

[code]static float AgsImGui.GetTreeNodeToLabelSpacing()[/code]

Horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode.

[*] [b][tt]AgsImGui.CollapsingHeader[/tt][/b]

[code]static bool AgsImGui.CollapsingHeader(String label, ImGuiTreeNodeFlags flags = 0)[/code]

If returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().

[hr]

[i][b]Tooltips[/b][/i]

Tooltip are windows following the mouse which do not take focus away.

Remember we can only have one active tooltip at all times, and the last one called is the active one.

[*] [b][tt]AgsImGui.BeginTooltip[/tt][/b]

[code]static void AgsImGui.BeginTooltip()[/code]

Begin/append a tooltip window. to create full-featured tooltip (with any kind of items). Doesn't return nothing.

[*] [b][tt]AgsImGui.EndTooltip[/tt][/b]

[code]static void AgsImGui.EndTooltip()[/code]

Always call after a BeginTooltip block!

[*] [b][tt]AgsImGui.SetTooltip[/tt][/b]

[code]static void AgsImGui.SetTooltip(String text)[/code]

Set a text-only tooltip, typically use with AgsImGui.IsItemHovered(). Override any previous call to SetTooltip().

Example:
[code=AGS]
AgsImGui.Button("Clicks for nothing!");
if(AgsImGui.IsItemHovered()) AgsImGui.SetTooltip("Button is hovered!");

[big][/code][/big]

[i][b]Popups and Modals[/b][/i]

[*] [b][tt]AgsImGui.OpenPopup[/tt][/b]

[code]static void AgsImGui.OpenPopup(String str_id)[/code]

call to mark popup as open (don't call every frame!). Popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.

Popup identifiers are relative to the current ID-stack.

Example:
[code=AGS]
// If the button is in the Window, this code goes inside the window.
if(AgsImGui.BeginPopup("my_popup")){
  AgsImGui.Text("This is a popup");
  AgsImGui.EndPopup(); 
}
if(AgsImGui.Button("open popup"))
{
  AgsImGui.OpenPopup("my_popup");
}
[/code]

[*] [b][tt]AgsImGui.BeginPopup[/tt][/b]

[code]static bool AgsImGui.BeginPopup(String str_id, ImGuiWindowFlags flags = 0)[/code]

Return true if the popup is open, and you can start outputting to it.
Only call EndPopup() if BeginPopup() returns true!

Generally you will want to run this on every frame, and it will return true once the popup has been made open,
and return false again once it's closed.

[*] [b][tt]AgsImGui.BeginPopupModal[/tt][/b]

[code]static bool AgsImGui.BeginPopupModal(String name, bool has_close_button = 0, ImGuiWindowFlags flags = 0)[/code]

Modal dialog, a regular window with title bar, block interactions behind the modal window, and you can't close the
modal window by clicking outside.

[*] [b][tt]AgsImGui.EndPopup[/tt][/b]

[code]static void AgsImGui.EndPopup()[/code]

Only call EndPopup() if BeginPopupXXX() returns true!

[*] [b][tt]AgsImGui.IsPopupOpen[/tt][/b]

[code]static bool AgsImGui.IsPopupOpen(String str_id)[/code]

Return true if the popup is open at the current begin-ed level of the popup stack.

[*] [b][tt]AgsImGui.CloseCurrentPopup[/tt][/b]

[code]static void AgsImGui.CloseCurrentPopup()[/code]

Close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.

[hr]

[i][b]Tab Bars, Tabs[/b][/i]

[*] [b][tt]AgsImGui.BeginTabBar[/tt][/b]

[code]static bool AgsImGui.BeginTabBar(String str_id, ImGuiTabBarFlags flags = 0)[/code]

create and append into a TabBar

[*] [b][tt]AgsImGui.EndTabBar[/tt][/b]

[code]static void AgsImGui.EndTabBar()[/code]

only call EndTabBar() if BeginTabBar() returns true!

[*] [b][tt]AgsImGui.BeginTabItem[/tt][/b]

[code]static bool AgsImGui.BeginTabItem(String label, bool has_close_button = 0, ImGuiTabItemFlags flags = 0)[/code]

create a Tab. Returns true if the Tab is selected.

[*] [b][tt]AgsImGui.EndTabItem[/tt][/b]

[code]static void AgsImGui.EndTabItem()[/code]

only call EndTabItem() if BeginTabItem() returns true!

[*] [b][tt]AgsImGui.SetTabItemClosed[/tt][/b]

[code]static void AgsImGui.SetTabItemClosed(String tab_or_docked_window_label)[/code]

notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.

[hr]

[i][b]Menus[/b][/i]

[*] [b][tt]AgsImGui.BeginMenuBar[/tt][/b]

[code]static bool AgsImGui.BeginMenuBar()[/code]

Append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).

[*] [b][tt]AgsImGui.EndMenuBar[/tt][/b]

[code]static void AgsImGui.EndMenuBar()[/code]

Only call EndMenuBar() if BeginMenuBar() returns true!

[*] [b][tt]AgsImGui.BeginMainMenuBar[/tt][/b]

[code]static bool AgsImGui.BeginMainMenuBar()[/code]

Create and append to a full screen menu-bar.

[*] [b][tt]AgsImGui.EndMainMenuBar[/tt][/b]

[code]static void AgsImGui.EndMainMenuBar()[/code]

Only call EndMainMenuBar() if BeginMainMenuBar() returns true!

[*] [b][tt]AgsImGui.BeginMenu[/tt][/b]

[code]static bool AgsImGui.BeginMenu(String label, bool enabled = true)[/code]

Create a sub-menu entry. Only call EndMenu() if this returns true!

[*] [b][tt]AgsImGui.EndMenu[/tt][/b]

[code]static void AgsImGui.EndMenu()[/code]

Only call EndMenu() if BeginMenu() returns true!

[*] [b][tt]AgsImGui.MenuItem[/tt][/b]

[code]static bool AgsImGui.MenuItem(String label, String shortcut, bool selected = false, bool enabled = true)[/code]

return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment!

[hr]

[i][b]General Helpers[/b][/i]

[*] [b][tt]AgsImGuiHelper.SetClipboarText[/tt][/b]

[code]static void AgsImGuiHelper.SetClipboarText(String text)[/code]

[*] [b][tt]AgsImGuiHelper.GetClipboarText[/tt][/b]

[code]static String AgsImGuiHelper.GetClipboarText()[/code]

[hr]

[i][b]ImVec2[/b][/i]

This is a format used to describe either x,y points or zero origin rectangles and other things that can be described as vectors.
It's used more in the attributes of a [tt]ImGuiStyle[/tt] object.

[i][b]ImVec4[/b][/i]

This is a format used to describe either x,y,w,z points or any origin rectangles and other things that can be described as vectors with 4 coordinates.
It's the preferable format for ImGui Colors, and used a lot for this! It's used more in the attributes of a [tt]ImGuiStyle[/tt] object.

[i][b]ImGuiStyle[/b][/i]

A big object used to describe the theme in ImGui.

[i][b]Enums[/b][/i]

[code]ImGuiCond[/code]

[list]
[*] [tt]eImGuiCond_Always[/tt], used when condition should always trigger, is usually the default when the AgImGui API requires
conditions.
[*] [tt]eImGuiCond_Once[/tt], Set the variable once per runtime session (only the first call with succeed).
[*] [tt]eImGuiCond_FirstUseEver[/tt], Set the variable if the object/window has no persistently saved data (no entry in .ini file).
[*] [tt]eImGuiCond_Appearing[/tt], Set the variable if the object/window is appearing after being hidden/inactive (or the first time).
[/list]

[code]ImGuiDir[/code]

[list]
[*] [tt]eImGuiDir_Left[/tt], left direction.
[*] [tt]eImGuiDir_Right[/tt], right direction.
[*] [tt]eImGuiDir_Up[/tt], up direction.
[*] [tt]eImGuiDir_Down[/tt], down direction.
[/list]

[code]ImGuiBeginWindow[/code]

obs: This is exclusive to AgsImGui implementation because in AGS we don't have pointers to primitive types.

In any cases below, you still have to call [tt]AgsImGui.EndWindow()[/tt].

[list]
[*] [tt]eImGuiBeginWindow_OK[/tt], the window is open.
[*] [tt]eImGuiBeginWindow_Collapsed[/tt], the window is collapsed (using the arrow at top left).
[*] [tt]eImGuiBeginWindow_OK_Closed[/tt] the window is closed. This value is only returned at mouse release frame, after clicking on close button!
[*] [tt]eImGuiBeginWindow_Collapsed_Closed[/tt] the window is both collapsed and closed, rare but theoretically possible.
[/list]

[code]ImGuiWindowFlags[/code]

[list]
[*] [tt]eImGuiWindowFlags_None[/tt] (= 0), Default.
[*] [tt]eImGuiWindowFlags_NoTitleBar[/tt], Disable title-bar
[*] [tt]eImGuiWindowFlags_NoResize[/tt], Disable user resizing with the lower-right grip
[*] [tt]eImGuiWindowFlags_NoMove[/tt],  Disable user moving the window
[*] [tt]eImGuiWindowFlags_NoScrollbar[/tt], Disable scrollbars (window can still scroll with mouse or programmatically)
[*] [tt]eImGuiWindowFlags_NoScrollWithMouse[/tt], Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set.
[*] [tt]eImGuiWindowFlags_NoCollapse[/tt], Disable user collapsing window by double-clicking on it
[*] [tt]eImGuiWindowFlags_AlwaysAutoResize[/tt], Resize every window to its content every frame
[*] [tt]eImGuiWindowFlags_NoBackground[/tt],Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f).
[*] [tt]eImGuiWindowFlags_NoSavedSettings[/tt], Never load/save settings in .ini file
[*] [tt]eImGuiWindowFlags_NoMouseInputs[/tt], Disable catching mouse, hovering test with pass through.
[*] [tt]eImGuiWindowFlags_MenuBar[/tt], Has a menu-bar
[*] [tt]eImGuiWindowFlags_HorizontalScrollbar[/tt], Allow horizontal scrollbar to appear (off by default).
[*] [tt]eImGuiWindowFlags_NoFocusOnAppearing[/tt], Disable taking focus when transitioning from hidden to visible state
[*] [tt]eImGuiWindowFlags_NoBringToFrontOnFocus[/tt], Disable bringing window to front when taking focus (e.g. clicking on it or programmatically giving it focus)
[*] [tt]eImGuiWindowFlags_AlwaysVerticalScrollbar[/tt], Always show vertical scrollbar (even if ContentSize.y < Size.y)
[*] [tt]eImGuiWindowFlags_AlwaysHorizontalScrollbar[/tt], Always show horizontal scrollbar (even if ContentSize.x < Size.x)
[*] [tt]eImGuiWindowFlags_AlwaysUseWindowPadding[/tt], Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
[*] [tt]eImGuiWindowFlags_NoNavInputs[/tt], No gamepad/keyboard navigation within the window
[*] [tt]eImGuiWindowFlags_NoNavFocus[/tt], No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
[*] [tt]eImGuiWindowFlags_UnsavedDocument[/tt], Append '*' to title without affecting the ID, as a convenience to avoid using the ### operator.
[*] [tt]eImGuiWindowFlags_NoNav[/tt], Disable navigation.
[*] [tt]eImGuiWindowFlags_NoDecoration[/tt], Disable decoration.
[*] [tt]eImGuiWindowFlags_NoInputs[/tt], Disable inputs.
[/list]

[code]enum ImGuiInputTextFlags[/code]

The enums of this type can be combined with bitwise operators.

[list]
[*] [tt]eImGuiInputTextFlags_None[/tt], (=0) default
[*] [tt]eImGuiInputTextFlags_CharsDecimal[/tt], Allow 0123456789.+-*/
[*] [tt]eImGuiInputTextFlags_CharsHexadecimal[/tt], Allow 0123456789ABCDEFabcdef
[*] [tt]eImGuiInputTextFlags_CharsUppercase[/tt], Turn a..z into A..Z
[*] [tt]eImGuiInputTextFlags_CharsNoBlank[/tt], Filter out spaces, tabs
[*] [tt]eImGuiInputTextFlags_AutoSelectAll[/tt], Select entire text when first taking mouse focus
[*] [tt]eImGuiInputTextFlags_EnterReturnsTrue[/tt], Return 'true' when Enter is pressed (as opposed to every time the value was modified).
[*] [tt]eImGuiInputTextFlags_CallbackCompletion[/tt], Callback on pressing TAB (for completion handling)
[*] [tt]eImGuiInputTextFlags_CallbackHistory[/tt], Callback on pressing Up/Down arrows (for history handling)
[*] [tt]eImGuiInputTextFlags_CallbackAlways[/tt], Callback on each iteration. User tt may query cursor position, modify text buffer.
[*] [tt]eImGuiInputTextFlags_CallbackCharFilter[/tt], Callback on character inputs to replace or discard them. Modify 'EventChar' to replace or discard, or return 1 in callback to discard.
[*] [tt]eImGuiInputTextFlags_AllowTabInput[/tt], Pressing TAB input a 't' character into the text field
[*] [tt]eImGuiInputTextFlags_CtrlEnterForNewLine[/tt], In multi-line mode, unfocus with Enter, add new line with Ctrl+Enter (default is opposite: unfocus with Ctrl+Enter, add line with Enter).
[*] [tt]eImGuiInputTextFlags_NoHorizontalScroll[/tt], Disable following the cursor horizontally
[*] [tt]eImGuiInputTextFlags_AlwaysInsertMode[/tt], Insert mode
[*] [tt]eImGuiInputTextFlags_ReadOnly[/tt], Read-only mode
[*] [tt]eImGuiInputTextFlags_Password[/tt], Password mode, display all characters as '*'
[[/cur]] [tt]eImGuiInputTextFlags_NoUndoRedo[/tt], Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
[*] [tt]eImGuiInputTextFlags_CharsScientific[/tt], Allow 0123456789.+-*/eE (Scientific notation input)
[*] [tt]eImGuiInputTextFlags_CallbackResize[/tt], Callback on buffer capacity changes request (beyond 'buf_size' parameter value), allowing the string to grow.
[/list]

[code]enum ImGuiCol_[/code]

The enums of this type can be combined with bitwise operators.

Used for selecting a specific color from the [tt]ImGuiStyle.Colors[][/tt] property. An example usage would be:

[code=AGS]
ImGuiStyle* style = ImGui.GetStyle();
style.Colors[eImGuiCol_WindowBg] = ImVec4.Create(1.0, 0.0, 0.0, 0.0);
ImGui.SetStyle(style);
[/code]

This would use the enum [tt]eImGuiCol_WindowBg[/tt] to access the desired color you want to modify,
which in the example sets to a red color.

[list]
[*] [tt]eImGuiCol_Text[/tt],
[*] [tt]eImGuiCol_TextDisabled[/tt],
[*] [tt]eImGuiCol_WindowBg[/tt], Background of normal windows
[*] [tt]eImGuiCol_ChildBg[/tt], Background of child windows
[*] [tt]eImGuiCol_PopupBg[/tt], Background of popups, menus, tooltips windows
[*] [tt]eImGuiCol_Border[/tt],
[*] [tt]eImGuiCol_BorderShadow[/tt],
[*] [tt]eImGuiCol_FrameBg[/tt], Background of checkbox, radio button, plot, slider, text input
[*] [tt]eImGuiCol_FrameBgHovered[/tt],
[*] [tt]eImGuiCol_FrameBgActive[/tt],
[*] [tt]eImGuiCol_TitleBg[/tt],
[*] [tt]eImGuiCol_TitleBgActive[/tt],
[*] [tt]eImGuiCol_TitleBgCollapsed[/tt],
[*] [tt]eImGuiCol_MenuBarBg[/tt],
[*] [tt]eImGuiCol_ScrollbarBg[/tt],
[*] [tt]eImGuiCol_ScrollbarGrab[/tt],
[*] [tt]eImGuiCol_ScrollbarGrabHovered[/tt],
[*] [tt]eImGuiCol_ScrollbarGrabActive[/tt],
[*] [tt]eImGuiCol_CheckMark[/tt],
[*] [tt]eImGuiCol_SliderGrab[/tt],
[*] [tt]eImGuiCol_SliderGrabActive[/tt],
[*] [tt]eImGuiCol_Button[/tt],
[*] [tt]eImGuiCol_ButtonHovered[/tt],
[*] [tt]eImGuiCol_ButtonActive[/tt],
[*] [tt]eImGuiCol_Header[/tt], Header* colors are used for CollapsingHeader, TreeNode, Selectable, MenuItem
[*] [tt]eImGuiCol_HeaderHovered[/tt],
[*] [tt]eImGuiCol_HeaderActive[/tt],
[*] [tt]eImGuiCol_Separator[/tt],
[*] [tt]eImGuiCol_SeparatorHovered[/tt],
[*] [tt]eImGuiCol_SeparatorActive[/tt],
[*] [tt]eImGuiCol_ResizeGrip[/tt],
[*] [tt]eImGuiCol_ResizeGripHovered[/tt],
[*] [tt]eImGuiCol_ResizeGripActive[/tt],
[*] [tt]eImGuiCol_Tab[/tt],
[*] [tt]eImGuiCol_TabHovered[/tt],
[*] [tt]eImGuiCol_TabActive[/tt],
[*] [tt]eImGuiCol_TabUnfocused[/tt],
[*] [tt]eImGuiCol_TabUnfocusedActive[/tt],
[*] [tt]eImGuiCol_PlotLines[/tt],
[*] [tt]eImGuiCol_PlotLinesHovered[/tt],
[*] [tt]eImGuiCol_PlotHistogram[/tt],
[*] [tt]eImGuiCol_PlotHistogramHovered[/tt],
[*] [tt]eImGuiCol_TextSelectedBg[/tt],
[*] [tt]eImGuiCol_DragDropTarget[/tt],
[*] [tt]eImGuiCol_NavHighlight[/tt], Gamepad/keyboard: current highlighted item;
[*] [tt]eImGuiCol_NavWindowingHighlight[/tt], Highlight window when using CTRL+TAB;
[*] [tt]eImGuiCol_NavWindowingDimBg[/tt], Darken/colorize entire screen behind the CTRL+TAB window list, when active;
[*] [tt]eImGuiCol_ModalWindowDimBg[/tt], Darken/colorize entire screen behind a modal window, when one is active;
[*] [tt]eImGuiCol_COUNT[/tt], The total numbers of items in ImGuiStyle.Colors attribute array. Useful for iterating all colors.
[/list]
[/spoiler]

[b][size=12pt]FAQ[/size][/b]

[i][b]How do I make mouse wheel work?[/b][/i]

First, make sure you have mouse wheel support enabled in Global Settings.

Then, in some script, add the code below. Note: If the script is a Room script, it will only work in that room.
[code=AGS Script]
void on_mouse_click (int btn){
  if(btn == eMouseWheelNorth){
    AgsImGui.DoMouseWheel(eImGuiDir_Down);
  } else if(btn == eMouseWheelSouth){
    AgsImGui.DoMouseWheel(eImGuiDir_Up);   
  } 
}
[/code]
For now, mouse wheel events are not exposed in the AGS Plugin API, so you have to do it through script. In the future, if this changes, it will be integrated in the plugin.

[b][size=12pt]License and Author[/size][/b]

AgsImGui is made by eri0o provided with MIT [url=https://github.com/ericoporto/agsimgui/blob/master/LICENSE]LICENSE[/url].

Using ocornut Dear ImGui, and also using software renderer with modifications from LAK132, and using other changes to ensure AGS compatibility, provided with MIT License.

Additionally using David Cappelo clip library for providing cross platform clipboard integration, also provided with MIT License.