Skip to content

Commit

Permalink
fixes to add styling example and to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericoporto committed Jun 7, 2020
1 parent 9e95ebf commit 4cdebbc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 20 additions & 1 deletion README.md
Expand Up @@ -58,6 +58,25 @@ no guidance is given.

### Main

#### `AgsImGui.GetStyle`

`static ImGuiStyle* GetStyle()`

Gets the Style customization use in AgsImGui. Check [`ImGuiStyle`](#imguistyle) for more information.

#### `AgsImGui.SetStyle`

`static void SetStyle(ImGuiStyle* imGuiStyle)`

Sets the Style customization use in AgsImGui. Check [`ImGuiStyle`](#imguistyle) for more information.

```AGS Script
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);
```

#### `AgsImGui.NewFrame`

`static void AgsImGui.NewFrame()`
Expand Down Expand Up @@ -834,7 +853,7 @@ When used for colors correspond to the color Blue.
`attribute float ImVec4.W`

It's the W attribute of a ImVec4 object. Usually represents the length in the vertical axis.
When used for colors correspond to the alpha of the colors, where `1.0` is transparent and `0.0` is opaque.
When used for colors correspond to the alpha of the colors, where `0.0` is transparent and `1.0` is opaque.

#### `ImVec4.Scale`

Expand Down
5 changes: 2 additions & 3 deletions agsimgui_demo/room4.asc
Expand Up @@ -21,7 +21,6 @@ function room_RepExec()
// AGS will actually draw this on screen later on, on Post Screen Draw stage.
}

ImGuiStyle* style;
void on_mouse_click (int btn){
if(btn == eMouseWheelNorth){
AgsImGui.DoMouseWheel(eImGuiDir_Down);
Expand Down Expand Up @@ -50,8 +49,8 @@ function room_Load()
ImVec4* hover = ImVec4.Create(0.40, 0.87, 0.84, 0.20);

AgsImGui.StyleColorsLight();
style = AgsImGui.GetStyle();

ImGuiStyle* style = AgsImGui.GetStyle();

style.Colors[eImGuiCol_Text] = text;
style.Colors[eImGuiCol_WindowBg] = background;
Expand Down

0 comments on commit 4cdebbc

Please sign in to comment.