3#include "SpriteRenderComponent.h"
5#include "Resources/Resources.h"
16 class TransformComponent;
122 glm::vec4
color = glm::vec4(1, 1, 1, 1);
142template<>
inline Cogs::StringView getName<Cogs::Core::VerticalAlignment>() {
return "VerticalAlignment"; }
143template<>
inline Cogs::StringView getName<Cogs::Core::HorizontalAlignment>() {
return "HorizontalAlignment"; }
144template<>
inline Cogs::StringView getName<Cogs::Core::HorizontalJustification>() {
return "HorizontalJustification"; }
146template<>
inline Cogs::StringView getName<Cogs::Core::TextComponent>() {
return "TextComponent"; }
Base class for Component instances.
Renders the given text(s) by generating sprites.
std::vector< glm::vec3 > positions
Offset positions for each of the strings in texts.
HorizontalJustification horizontalJustification
Horizontal justification of the text.
VerticalAlignment verticalAlignment
Vertical alignment of the text.
std::vector< std::string > texts
A set of text strings to render.
static void registerType()
Register the type in the type system.
PositionMode positionMode
Positioning mode of the text.
std::vector< glm::vec4 > colors
Colors for individual strings in text.
glm::vec4 color
Single color value to apply to all text strings.
FontHandle fontHandle
Handle to the font resource to use when rendering text.
Provides a weakly referenced view over the contents of a string.
PositionMode
Positioning mode.
@ Pixels
Position given in screen pixels ranging from [0, 0] in the lower left corner to [viewport....
HorizontalJustification
Horizontal justification modes for text.
@ Left
The leftmost character is placed to the right of the screen position.
HorizontalAlignment
Horizontal alignment of overlays.
VerticalAlignment
Defines vertical alignment modes for text.
@ Center
Center the text on the screen position.
Contains all Cogs related functionality.
Handle to a Component instance.
static ComponentHandle Empty()
Returns an empty, invalid handle. Will evaluate to false if tested against using operator bool().
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.