63 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
70 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, with (0,0) being its top left corner and (1,...
Definition ui_image.hpp:118
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Creates a new UIImage instance from its description in JSON.
Definition ui_image.cpp:11
void onActivated() override
Loads and displays the image associated with this aspect when it is added to the active scene.
Definition ui_image.cpp:46
std::shared_ptr< BaseSimObjectAspect > clone() const override
Constructs a new UIImage using this object as its blueprint.
Definition ui_image.cpp:38
static std::string getSimObjectAspectTypeName()
Gets the aspect type string associated with this class.
Definition ui_image.hpp:55
UIImage()
Constructs a new UIImage aspect.
Definition ui_image.hpp:48
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:56
void recomputeTexture()
Recomputes the texture associated with this object's StaticModel.
Definition ui_image.cpp:68
glm::uvec2 mDimensions
The dimensions within which the loaded image will be displayed.
Definition ui_image.hpp:124
void updateAnchor(const glm::vec2 &anchor)
Updates the point considered the origin of this object's StaticModel.
Definition ui_image.cpp:50
void updateImage(const std::string &imageFilepath)
Updates the image associated with this object.
Definition ui_image.cpp:62
std::string mImageFilepath
The file from which the image to be displayed was loaded.
Definition ui_image.hpp:112
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition application.hpp:24
Classes and structs relating to the SimSystem, the system responsible for providing some level of gen...
Header containing definitions of classes and functions related to loading and using Texture resources...