8 #ifndef UI_FACTORY_HPP_
9 #define UI_FACTORY_HPP_
11 #include "Factory.hpp"
12 #include "GameObject.hpp"
13 #include "UiImage.hpp"
15 #include "UiCanvas.hpp"
42 static std::shared_ptr<GameObject> createCanvas(
SceneManagement::Scene &scene, std::string
const& name =
"Canvas") {
43 PROFILER_FUNC_START();
44 auto result = Factory::createEmptyGameObject(scene, name);
46 auto canvasComp = std::make_shared<Canvas>(result);
47 result->addComponent(canvasComp);
54 static std::shared_ptr<GameObject> createImage(
SceneManagement::Scene &scene, std::string
const& name =
"Image", std::string
const& pathImage =
"",
Tools::Rectangle const& rect = {0, 0, 0, 0}) {
55 PROFILER_FUNC_START();
56 auto result = Factory::createEmptyGameObject(scene, name);
57 std::shared_ptr<Image> imgComponent = std::make_shared<Image>(result);
58 result->addComponent(imgComponent);
60 imgComponent->setPathSprite(pathImage);
61 imgComponent->setRectangle(rect);
68 static std::shared_ptr<GameObject> createText(
SceneManagement::Scene &scene, std::string
const& name =
"Text") {
69 PROFILER_FUNC_START();
70 auto result = Factory::createEmptyGameObject(scene, name);
71 std::shared_ptr<Text> txtComponent = std::make_shared<Text>(result);
72 result->addComponent(txtComponent);