UI Hello World
This commit is contained in:
32
src/dawn/scene/components/ui/UICanvas.cpp
Normal file
32
src/dawn/scene/components/ui/UICanvas.cpp
Normal 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() {
|
||||
|
||||
}
|
Reference in New Issue
Block a user