dark overlay is an ui element now

This commit is contained in:
MihailRis
2024-01-26 15:50:50 +03:00
parent 51ffb93230
commit c6a2fc90a8
8 changed files with 25 additions and 24 deletions
+9 -1
View File
@@ -22,7 +22,9 @@ shared_ptr<UINode> Container::getAt(vec2 pos, shared_ptr<UINode> self) {
return nullptr;
}
if (!isInside(pos)) return nullptr;
for (auto node : nodes) {
for (int i = nodes.size()-1; i >= 0; i--) {
auto& node = nodes[i];
if (!node->visible())
continue;
auto hover = node->getAt(pos, node);
@@ -91,6 +93,12 @@ void Container::draw(Batch2D* batch, Assets* assets) {
Window::popScissor();
}
void Container::addBack(shared_ptr<UINode> node) {
nodes.insert(nodes.begin(), node);
node->setParent(this);
refresh();
}
void Container::add(shared_ptr<UINode> node) {
nodes.push_back(node);
node->setParent(this);