27#include "toymaker/sim_system.hpp"
73 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
81 std::shared_ptr<BaseSimObjectAspect>
clone()
const override;
An object containing closely related methods and data, and exposing object lifecycle and application ...
Definition sim_system.hpp:956
glm::vec2 mAnchor
The point considered the origin of this object, where (0,0) represents the top left corner and (1,...
Definition ui_panel.hpp:134
void updateAnchor(glm::vec2 anchor)
Updates the point considered the new origin for this object, where (0,0) represents the top left corn...
Definition ui_panel.cpp:36
void updateContentSize(glm::vec2 contentSize)
Updates the size of the central region of the NineSlicePanel.
Definition ui_panel.cpp:31
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Constructs a new UIPanel instance based on its JSON description.
Definition ui_panel.cpp:4
std::shared_ptr< NineSlicePanel > mBasePanel
The panel resource used to create this texture.
Definition ui_panel.hpp:122
static std::string getSimObjectAspectTypeName()
Gets the aspect type string associated with this class.
Definition ui_panel.hpp:65
glm::vec2 mContentSize
The size of the central area of the nine slice panel in which content can be displayed.
Definition ui_panel.hpp:128
void recomputeTexture()
The method responsible for actually creating the new texture through the loaded panel resource.
Definition ui_panel.cpp:61
void updateBasePanel(std::shared_ptr< NineSlicePanel > newPanel)
Changes the panel resource used to create this object's panel texture.
Definition ui_panel.cpp:41
UIPanel()
Constructs a new UIPanel aspect.
Definition ui_panel.hpp:57
std::shared_ptr< BaseSimObjectAspect > clone() const override
Constructs a new UIPanel instance using this one as a blueprint.
Definition ui_panel.cpp:47
void onActivated() override
Loads and renders the texture of a panel per its configuration.
Definition ui_panel.cpp:57
Contains class defining this project's implementation of nine-slice (or nine-region) resizable panels...