mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
lua: gui library (WIP)
This commit is contained in:
parent
302b649634
commit
05589b721e
14 changed files with 262 additions and 25 deletions
|
|
@ -30,6 +30,14 @@ const std::shared_ptr<gui::UINode> UiDocument::getRoot() const {
|
|||
return root;
|
||||
}
|
||||
|
||||
const std::shared_ptr<gui::UINode> UiDocument::get(const std::string& id) const {
|
||||
auto found = map.find(id);
|
||||
if (found == map.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return found->second;
|
||||
}
|
||||
|
||||
const uidocscript& UiDocument::getScript() const {
|
||||
return script;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public:
|
|||
const std::string& getId() const;
|
||||
const uinodes_map& getMap() const;
|
||||
const std::shared_ptr<gui::UINode> getRoot() const;
|
||||
const std::shared_ptr<gui::UINode> get(const std::string& id) const;
|
||||
const uidocscript& getScript() const;
|
||||
int getEnvironment() const;
|
||||
/* Collect map of all uinodes having identifiers */
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ void UINode::setCoord(glm::vec2 coord) {
|
|||
this->coord = coord;
|
||||
}
|
||||
|
||||
glm::vec2 UINode::getCoord() const {
|
||||
return coord;
|
||||
}
|
||||
|
||||
glm::vec2 UINode::getSize() const {
|
||||
return size;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ namespace gui {
|
|||
/* Calculate screen position of the element */
|
||||
virtual glm::vec2 calcCoord() const;
|
||||
virtual void setCoord(glm::vec2 coord);
|
||||
glm::vec2 getCoord() const;
|
||||
virtual glm::vec2 getSize() const;
|
||||
virtual void setSize(glm::vec2 size);
|
||||
virtual void refresh() {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue