Skip to content

Commit

Permalink
Docs Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercuber55 committed Oct 23, 2023
1 parent dbd9d71 commit df396be
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cube2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ struct Rect {
#ifdef CGE_RAYGUI
struct GuiWindow {

bool Drag;
bool Hidden;

float x, y, w, h;
Camera2D Cam;
std::string Title;

GuiWindow(Rectangle Destination, std::string Title);

void Update();
void Draw(std::function<void(Vector2 Offset)> Function);

private: bool Drag;
};
#endif // CGE_RAYGUI

Expand Down
54 changes: 54 additions & 0 deletions docs/Documentation/Classes/GuiWindow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: GuiWindow
layout: default
nav_order: 3
parent: Classes
grand_parent: Documentation
has_children: true
---

# GuiWindow
{: .warning }
This class is not enabled by default and must be enabled in order to use by passing `-D CGE_RAYGUI` as one of CXXFLAGS.

## Source Code
Its good to have a source code look at what you use then we will look on them one by one.
```cpp
struct GuiWindow {

bool Hidden;

float x, y, w, h;
std::string Title;

GuiWindow(Rectangle Destination, std::string Title);

void Update();
void Draw(std::function<void(Vector2 Offset)> Function);

private: bool Drag;
};
```
## Usage
Create a instance in your scene class and call its `Update` function in your scene's `Update` function and same goes for `Draw` function but a little different, pass a lamda function to the `Draw` function where you should add offset to your gui items.
## Variables
## `bool Hidden`
Determines if the window is hidden.
## `float x, y, w, h`
Determines the position and the size of the window.
## `std::string Title`
Determines the title of the window.
## `GuiWindow(Rectangle Destination, std::string Title)`
Constructs a new instance with given position, size and title.
## `void Update()`
Updates the window.
## `void Draw(std::function<void(Vector2 Offset)> Function)`
Draws the window to the screen along with the gui items inside `Function`.
2 changes: 1 addition & 1 deletion docs/Documentation/Classes/Rect.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Rect
layout: default
nav_order: 1
nav_order: 2
parent: Classes
grand_parent: Documentation
has_children: true
Expand Down

0 comments on commit df396be

Please sign in to comment.