UI Hello World

This commit is contained in:
2022-10-23 01:01:16 -07:00
parent be529b70c1
commit 182eb70361
25 changed files with 663 additions and 41 deletions

View File

@ -0,0 +1,32 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "UICanvas.hpp"
#include "scene/Scene.hpp"
#include "ui/UIComponent.hpp"
#include "game/DawnGame.hpp"
using namespace Dawn;
std::shared_ptr<UICanvas> UICanvas::createCanvas(std::shared_ptr<Scene> scene) {
auto item = scene->createSceneItem();
return item->addComponent<UICanvas>();
}
UICanvas::UICanvas(SceneItem &item) : SceneItemComponent(item) {
}
float_t UICanvas::getWidth() {
return this->getGame().renderManager.getBackBuffer().getWidth();
}
float_t UICanvas::getHeight() {
return this->getGame().renderManager.getBackBuffer().getHeight();
}
void UICanvas::start() {
}