46 static std::shared_ptr<BaseSimObjectAspect>
create(
const nlohmann::json& jsonAspectProperties);
53 std::shared_ptr<BaseSimObjectAspect>
clone()
const override;
94 void updateFont(
const std::string& textResourceName);
114 glm::u8vec4
mColor {0x00, 0x00, 0x00, 0xFF};
120 std::shared_ptr<ToyMaker::TextFont>
mFont {};
An object containing closely related methods and data, and exposing object lifecycle and application ...
Definition sim_system.hpp:956
std::shared_ptr< BaseSimObjectAspect > clone() const override
Constructs a new UIText instance using this one as its blueprint.
Definition ui_text.cpp:61
void updateText(const std::string &newText)
Updates the text rendered by this object.
Definition ui_text.cpp:82
void updateFont(const std::string &textResourceName)
Updates the font using which this object's text texture is rendered.
Definition ui_text.cpp:88
void onActivated() override
Renders the initial text associated with this object once it becomes a part of the active scene.
Definition ui_text.cpp:72
std::string mText
The text displayed by this object on its associated StaticModel surface.
Definition ui_text.hpp:126
static std::shared_ptr< BaseSimObjectAspect > create(const nlohmann::json &jsonAspectProperties)
Creates a new UIText aspect based on its JSON description.
Definition ui_text.cpp:11
float mScale
The scale, relative to the texture's dimensions, with which the object is made.
Definition ui_text.hpp:132
uint32_t mMaxWidthPixels
The width, in pixels, a single line of text is rendered on before it is wrapped around to the next li...
Definition ui_text.hpp:138
void updateScale(float scale)
Updates the scale of this object.
Definition ui_text.cpp:76
std::shared_ptr< ToyMaker::TextFont > mFont
The font used to render the text texture used by this object.
Definition ui_text.hpp:120
static std::string getSimObjectAspectTypeName()
Gets the aspect type string for this class.
Definition ui_text.hpp:38
UIText()
Constructs a new UIText aspect.
Definition ui_text.hpp:31
void updateColor(glm::u8vec4 newColour)
Updates the color of the text rendered by this object.
Definition ui_text.cpp:103
void recomputeTexture()
Recomputes the text texture and vertex offsets associated with this object based on its configuration...
Definition ui_text.cpp:109
void updateAnchor(glm::vec2 anchor)
Updates the point considered this object's origin, where (0,0) represents the top left corner of the ...
Definition ui_text.cpp:97
std::string getText() const
Gets the actual text associated with this UIText object.
Definition ui_text.hpp:66
glm::u8vec4 mColor
The color associated with the text rendered by this object.
Definition ui_text.hpp:114
glm::vec2 mAnchor
The point considered the origin of this object, where (0,0) represents the top left hand corner,...
Definition ui_text.hpp:144
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...
Classes relating to the creation and use of fonts to render text.