mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
add gui.create_frame
This commit is contained in:
parent
3014329280
commit
463098aa1e
8 changed files with 84 additions and 24 deletions
|
|
@ -61,6 +61,7 @@ namespace gui {
|
|||
class UINode;
|
||||
class Container;
|
||||
class Menu;
|
||||
class Frame;
|
||||
|
||||
/// @brief The main UI controller
|
||||
class GUI {
|
||||
|
|
@ -80,6 +81,7 @@ namespace gui {
|
|||
std::shared_ptr<Menu> menu;
|
||||
std::queue<runnable> postRunnables;
|
||||
std::vector<std::weak_ptr<UINode>> mouseOver;
|
||||
std::unordered_map<std::string, std::shared_ptr<Frame>> frames;
|
||||
|
||||
float tooltipTimer = 0.0f;
|
||||
float doubleClickTimer = 0.0f;
|
||||
|
|
@ -112,6 +114,8 @@ namespace gui {
|
|||
/// @param viewport window size
|
||||
void act(float delta, const glm::uvec2& viewport);
|
||||
|
||||
void renderFrames(const DrawContext& pctx, Assets& assets);
|
||||
|
||||
/// @brief Draw all visible elements on main container
|
||||
/// @param pctx parent graphics context
|
||||
/// @param assets active assets storage
|
||||
|
|
@ -123,6 +127,8 @@ namespace gui {
|
|||
/// @param node UI element
|
||||
void add(std::shared_ptr<UINode> node);
|
||||
|
||||
void addFrame(std::shared_ptr<Frame> frame);
|
||||
|
||||
/// @brief Remove node from the main container
|
||||
void remove(UINode* node) noexcept;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue