improved docs
This commit is contained in:
parent
c8f1c90f9c
commit
dfe9b1abe9
16 changed files with 315 additions and 40 deletions
|
|
@ -37,6 +37,13 @@ export namespace Crafter {
|
|||
int32_t height;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents a GUI window handling input events, mouse states, keyboard states, and UI elements.
|
||||
*
|
||||
* The Window class encapsulates event handling for mouse and keyboard interactions,
|
||||
* manages the state of the mouse and keyboard, and stores UI elements contained within the window.
|
||||
* It also holds window-specific properties such as name, dimensions, and scaling factor.
|
||||
*/
|
||||
class Window {
|
||||
public:
|
||||
Event<MousePoint> onMouseRightClick;
|
||||
|
|
@ -68,7 +75,19 @@ export namespace Crafter {
|
|||
std::uint32_t height;
|
||||
float scale = 1;
|
||||
bool open = true;
|
||||
/**
|
||||
* @brief Constructs a Window with a given name and dimensions.
|
||||
* @param name The title of the window.
|
||||
* @param width The width of the window in pixels.
|
||||
* @param height The height of the window in pixels.
|
||||
*/
|
||||
Window(std::string name, std::uint32_t width, std::uint32_t height);
|
||||
/**
|
||||
* @brief Calculates the real position and size of an UiElement
|
||||
*
|
||||
* @param element The UI element to get the position from.
|
||||
* @return The actual position and size of the element after scaling.
|
||||
*/
|
||||
ScaleData ScaleElement(const UiElement& element);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue