15#include "toymaker/sim_system.hpp"
16#include "toymaker/texture.hpp"
61 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
68 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
static std::string getSimObjectAspectTypeName()
Gets the aspect type string associated with this class.
Definition ui_image.hpp:53
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Creates a new UIImage instance from its description in JSON.
Definition ui_image.cpp:9
void onActivated() override
Loads and displays the image associated with this aspect when it is added to the active scene.
Definition ui_image.cpp:44
std::shared_ptr< BaseSimObjectAspect > clone() const override
Constructs a new UIImage using this object as its blueprint.
Definition ui_image.cpp:36
glm::vec2 mAnchor
The point considered the origin of this object, with (0,0) being its top left corner and (1,...
Definition ui_image.hpp:116
glm::uvec2 mDimensions
The dimensions within which the loaded image will be displayed.
Definition ui_image.hpp:122
void updateDimensions(const glm::uvec2 &dimensions)
Changes the dimensions the loaded image should be confined or scaled to (while maintaining its origin...
Definition ui_image.cpp:54
UIImage()
Constructs a new UIImage aspect.
Definition ui_image.hpp:46
void recomputeTexture()
Recomputes the texture associated with this object's StaticModel.
Definition ui_image.cpp:66
void updateAnchor(const glm::vec2 &anchor)
Updates the point considered the origin of this object's StaticModel.
Definition ui_image.cpp:48
void updateImage(const std::string &imageFilepath)
Updates the image associated with this object.
Definition ui_image.cpp:60
std::string mImageFilepath
The file from which the image to be displayed was loaded.
Definition ui_image.hpp:110